Right now, all of manifest constants are wrapped in `VarExp`, so you can see check it and skip `optimize` call when `flag == 1`.

In `TemplateInstance::semanticTiargs`:

```d
        else if (ea)
        {
        Lexpr:
            //printf("+[%d] ea = %s %s\n", j, Token::toChars(ea->op), ea->toChars());
            if (flags & 1)
            {
+                VarDeclaration *v;
+                if (ea->op == TOKvar && (v = ((VarExp *)ea)->var->isVarDeclaration()) != NULL &&
+                    v->storage_class & STCmanifest)
+                {
+                    // skip optimization
+                }
+               else
                    ea = ea->semantic(sc);
            }
            else
```

Extracting symbol from the kept `VarExp` in template arguments will be done with `getDsymbol` in `TraitsExp::semantic`.