|
@@ -2560,6 +2560,11 @@ bool Parser::ParseImplicitInt(DeclSpec &DS, CXXScopeSpec *SS,
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Early exit as Sema has a dedicated missing_actual_pipe_type diagnostic
|
|
|
|
+ // for incomplete declarations such as `pipe p`.
|
|
|
|
+ if (getLangOpts().OpenCLCPlusPlus && DS.isTypeSpecPipe())
|
|
|
|
+ return false;
|
|
|
|
+
|
|
if (getLangOpts().CPlusPlus &&
|
|
if (getLangOpts().CPlusPlus &&
|
|
DS.getStorageClassSpec() == DeclSpec::SCS_auto) {
|
|
DS.getStorageClassSpec() == DeclSpec::SCS_auto) {
|
|
// Don't require a type specifier if we have the 'auto' storage class
|
|
// Don't require a type specifier if we have the 'auto' storage class
|
|
@@ -3769,7 +3774,8 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
|
|
isInvalid = DS.SetTypeAltiVecBool(true, Loc, PrevSpec, DiagID, Policy);
|
|
isInvalid = DS.SetTypeAltiVecBool(true, Loc, PrevSpec, DiagID, Policy);
|
|
break;
|
|
break;
|
|
case tok::kw_pipe:
|
|
case tok::kw_pipe:
|
|
- if (!getLangOpts().OpenCL || (getLangOpts().OpenCLVersion < 200)) {
|
|
|
|
|
|
+ if (!getLangOpts().OpenCL || (getLangOpts().OpenCLVersion < 200 &&
|
|
|
|
+ !getLangOpts().OpenCLCPlusPlus)) {
|
|
// OpenCL 2.0 defined this keyword. OpenCL 1.2 and earlier should
|
|
// OpenCL 2.0 defined this keyword. OpenCL 1.2 and earlier should
|
|
// support the "pipe" word as identifier.
|
|
// support the "pipe" word as identifier.
|
|
Tok.getIdentifierInfo()->revertTokenIDToIdentifier();
|
|
Tok.getIdentifierInfo()->revertTokenIDToIdentifier();
|
|
@@ -4896,7 +4902,8 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) {
|
|
default: return false;
|
|
default: return false;
|
|
|
|
|
|
case tok::kw_pipe:
|
|
case tok::kw_pipe:
|
|
- return getLangOpts().OpenCL && (getLangOpts().OpenCLVersion >= 200);
|
|
|
|
|
|
+ return (getLangOpts().OpenCL && getLangOpts().OpenCLVersion >= 200) ||
|
|
|
|
+ getLangOpts().OpenCLCPlusPlus;
|
|
|
|
|
|
case tok::identifier: // foo::bar
|
|
case tok::identifier: // foo::bar
|
|
// Unfortunate hack to support "Class.factoryMethod" notation.
|
|
// Unfortunate hack to support "Class.factoryMethod" notation.
|
|
@@ -5384,7 +5391,8 @@ static bool isPtrOperatorToken(tok::TokenKind Kind, const LangOptions &Lang,
|
|
if (Kind == tok::star || Kind == tok::caret)
|
|
if (Kind == tok::star || Kind == tok::caret)
|
|
return true;
|
|
return true;
|
|
|
|
|
|
- if ((Kind == tok::kw_pipe) && Lang.OpenCL && (Lang.OpenCLVersion >= 200))
|
|
|
|
|
|
+ if (Kind == tok::kw_pipe &&
|
|
|
|
+ ((Lang.OpenCL && Lang.OpenCLVersion >= 200) || Lang.OpenCLCPlusPlus))
|
|
return true;
|
|
return true;
|
|
|
|
|
|
if (!Lang.CPlusPlus)
|
|
if (!Lang.CPlusPlus)
|