In: template<typename T> class foo {} enum A{b, c}; gets you: ~/ootbc/members/bin$ g++ foo.cc foo.cc:2: error: template declaration of `enum A' foo.cc:2: confused by earlier errors, bailing out The actual error is a missing semicolon. Ivan
On the mainline I get: t.cc:1: error: template declaration of 'enum' t.cc:2: error: multiple types in one declaration There might be a dup of this bug somewhere.
Yes, there are multiple PRs in the database about diagnostics when people forget the semicolon at the end of a struct or class declaration. There are also examples in these PRs that show why this case is so hard for the parser to handle gracefully. W.
Confirmed.
(In reply to comment #1) > On the mainline I get: > t.cc:1: error: template declaration of 'enum' > t.cc:2: error: multiple types in one declaration > > There might be a dup of this bug somewhere. Bug #16189 is the same and has some information why it's so hard to improve the error message. Please mark them a dupes.
(In reply to comment #4) Ok. *** This bug has been marked as a duplicate of 16189 ***