aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-05-09 18:56:43 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-05-09 18:56:43 +0000
commitf63eee78a3ed50a974d0963623a06888ecd4ef6b (patch)
tree61309dec24d0e814d21427a55936821fbe0bf85a /lib/Parse/ParseDecl.cpp
parent49033207b75216a956f3dbf7d018fb3343a54ec1 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156503 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 7cb6474678..e57db6ff9b 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/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());