Community
Participate
Working Groups
For the following (invalid) code: int Foo(int); struct Waldo { Waldo(int); }; int main() { Waldo var(Foo(UNRESOLVED)); } CDT parses the first statement in main() as a function declaration, with UNRESOLVED being an argument name (as indicated by the resulting syntax coloring). This would be appropriate if Foo were a type (it would then be an example of C++'s famous "vexing parse"), but given that Foo is a function, it is not appropriate. If UNRESOLVED is defined (as a variable or macro), the statement is parsed correctly as a variable declaration. The appropriate thing to do if UNRESOLVED is not defined, would be to still parse the statement as a variable decalration, and mark UNRESOLVED as being unresolved. This is what gcc and clang do.