diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-09-14 18:27:01 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-09-14 18:27:01 +0000 |
commit | b3cd3c0c8a234803dcb9b9c0dfe10106674141cd (patch) | |
tree | a62bf96b65096a60363bee2540c427f274668a87 /lib/Parse/ParseDecl.cpp | |
parent | a6ddea6adbef22d4e2673dbb7236186ac5b14e09 (diff) |
Fix some dead stores which the static analyzer warned about. No functionality
change (the problematic cases in ParseDecl.cpp are currently impossible).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index bcc9106eb7..f8a20c3b53 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -2277,6 +2277,8 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, isInvalid = DS.SetTypeSpecType(DeclSpec::TST_typename, Tok.getAnnotationEndLoc(), PrevSpec, DiagID, T); + if (isInvalid) + break; } else DS.SetTypeSpecError(); @@ -2482,12 +2484,12 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, case tok::kw___forceinline: { isInvalid = DS.SetFunctionSpecInline(Loc, PrevSpec, DiagID); IdentifierInfo *AttrName = Tok.getIdentifierInfo(); - SourceLocation AttrNameLoc = ConsumeToken(); + SourceLocation AttrNameLoc = Tok.getLocation(); // FIXME: This does not work correctly if it is set to be a declspec // attribute, and a GNU attribute is simply incorrect. DS.getAttributes().addNew(AttrName, AttrNameLoc, 0, AttrNameLoc, 0, SourceLocation(), 0, 0, AttributeList::AS_GNU); - continue; + break; } case tok::kw___ptr64: |