}
// Since this is almost certainly an invalid type name, emit a
- // diagnostic that says it, eat the token, and pretend we saw an 'int'.
+ // diagnostic that says it, eat the token, and mark the declspec as
+ // invalid.
Diag(Loc, diag::err_unknown_typename) << Tok.getIdentifierInfo();
- DS.SetTypeSpecType(DeclSpec::TST_int, Loc, PrevSpec);
+ DS.SetTypeSpecType(DeclSpec::TST_error, Loc, PrevSpec);
DS.SetRangeEnd(Tok.getLocation());
ConsumeToken();
// avoid rippling error messages on subsequent uses of the same type,
// could be useful if #include was forgotten.
- // FIXME: Mark DeclSpec as invalid.
goto DoneWithDeclSpec;
}
void (*signal(int, void (*)(int)))(int);
-int a, ***C, * const D, B(int);
+int aaaa, ***C, * const D, B(int);
int *A;
// PR3963 & rdar://6759604 - test error recovery for mistyped "typenames".
foo_t *d; // expected-error {{unknown type name 'foo_t'}}
-foo_t a = 4; // expected-error {{unknown type name 'foo_t'}}
+foo_t a; // expected-error {{unknown type name 'foo_t'}}
int test6() { return a; } // a should be declared.
// Use of tagged type without tag. rdar://6783347
return &b.y; // expected-warning {{incompatible pointer types returning 'int *', expected 'float *'}}
}
+struct xyz test8() { return a; } // a should be be marked invalid, no diag.
+
// Verify that implicit int still works.
static f; // expected-warning {{type specifier missing, defaults to 'int'}}