diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-05-09 18:56:43 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-05-09 18:56:43 +0000 |
commit | 3092a3b43c0e76d0ddae1a582f2939a63a458c7a (patch) | |
tree | dddec41625f5170e10807da78ab9968b5251287d /clang/lib/Parse/ParseDecl.cpp | |
parent | 7b1fee1fe515b29b7f601bd73e3f3a0237fe0c7c (diff) | |
download | bcm5719-llvm-3092a3b43c0e76d0ddae1a582f2939a63a458c7a.tar.gz bcm5719-llvm-3092a3b43c0e76d0ddae1a582f2939a63a458c7a.zip |
Stop AltiVec parsing from going down the 'implicit int' codepath as part of its
normal parse for token sequences like 'vector pixel foo'. This incidentally also
fixes a couple of wrong-parse issues.
llvm-svn: 156503
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 7cb64746781..e57db6ff9b2 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -1921,7 +1921,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, continue; case tok::annot_cxxscope: { - if (DS.hasTypeSpecifier()) + if (DS.hasTypeSpecifier() || DS.isTypeAltiVecVector()) goto DoneWithDeclSpec; CXXScopeSpec SS; @@ -2119,6 +2119,11 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, if (TryAltiVecToken(DS, Loc, PrevSpec, DiagID, isInvalid)) break; + // [AltiVec] 2.2: [If the 'vector' specifier is used] The syntax does not + // allow the use of a typedef name as a type specifier. + if (DS.isTypeAltiVecVector()) + goto DoneWithDeclSpec; + ParsedType TypeRep = Actions.getTypeName(*Tok.getIdentifierInfo(), Tok.getLocation(), getCurScope()); |