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:
parent
ba13e8db17
commit
2e3e756304
|
@ -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();
|
||||
|
|
|
@ -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}}
|
||||
|
||||
|
|
Loading…
Reference in New Issue