diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-12 22:12:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-12 22:12:26 +0000 |
commit | 33c6ebef6f9acad6eb667fff77ff78f0c169332c (patch) | |
tree | 721b4120702608528d3eb510c0d93454ba860e4e /lib/Parse/ParseDecl.cpp | |
parent | 798d5696ef5b4e3f47a6bed3c4f68f34c4810745 (diff) |
mark the declspec as invalid when we recover instead of forcing to int,
this allows downstream diags to be properly silenced.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68917 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index ae00ada311..5b8963f892 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -681,9 +681,10 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, } // 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(); @@ -691,7 +692,6 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, // 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; } |