Fix this bug:

typedef int f();
struct S {
   f *x; // incorrectly assuming this is function decl, leading to failed assertions.
};

llvm-svn: 57598
This commit is contained in:
Argyrios Kyrtzidis 2008-10-15 20:23:22 +00:00
parent ba13e8db17
commit 2e3e756304
2 changed files with 4 additions and 1 deletions

View File

@ -353,7 +353,9 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
}
bool isFunc = D.isFunctionDeclarator();
if (!isFunc && D.getDeclSpec().getTypeSpecType() == DeclSpec::TST_typedef) {
if (!isFunc &&
D.getDeclSpec().getTypeSpecType() == DeclSpec::TST_typedef &&
D.getNumTypeObjects() == 0) {
// Check also for this case:
//
// typedef int f();

View File

@ -26,6 +26,7 @@ public:
typedef int func();
func tm;
func *ptm;
func btm : 1; // expected-error {{error: bit-field 'btm' with non-integral type}}
NestedC bc : 1; // expected-error {{error: bit-field 'bc' with non-integral type}}