Bug 44514 - bad error recovery with forgotten ; after class definition
Summary: bad error recovery with forgotten ; after class definition
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2010-06-13 12:40 UTC by Manuel López-Ibáñez
Modified: 2010-12-07 14:46 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel López-Ibáñez 2010-06-13 12:40:41 UTC
Testcase:

template<class T>
class a {}
  class temp {};
a<temp> b;
struct b {
}

gcc-4.6:

clang-2.C:3:15: error: multiple types in one declaration
clang-2.C:4:7: error: non-template type ‘a’ used as a template
clang-2.C:4:10: error: invalid type in declaration before ‘;’ token
clang-2.C:6:1: error: expected unqualified-id at end of input

clang:

 t.cc:2:11: error: expected ';' after class
  class a {}
            ^
            ;
  t.cc:6:2: error: expected ';' after struct
  }
   ^
   ;
Comment 1 Nathan Froyd 2010-12-07 14:46:05 UTC
This has been fixed by the fix for PR 45331.  We now say:

/home/froydnj/src/x.C:2:10: error: expected ';' after class definition
/home/froydnj/src/x.C:6:1: error: expected ';' after struct definition