summaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorMikael Nilsson <mikael.nilsson@arm.com>2018-12-12 15:06:16 +0000
committerMikael Nilsson <mikael.nilsson@arm.com>2018-12-12 15:06:16 +0000
commitfbfddd394f19e2cc2ce853f1dad23b0d37c350c2 (patch)
tree9a619f061fbd417cdc8ef6cd34a5c8e752f57d9b /lib/Parse/ParseDecl.cpp
parent55b58df36e758826d6b27598ca37c211b8fecf8a (diff)
downloadclang-fbfddd394f19e2cc2ce853f1dad23b0d37c350c2.tar.gz
Revert "[OpenCL] Add generic AS to 'this' pointer"
Reverting because the patch broke lldb. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348931 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index caf443de63..bff91793d9 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -1427,7 +1427,7 @@ void Parser::ParseLexedAttribute(LateParsedAttribute &LA,
RecordDecl *RD = dyn_cast_or_null<RecordDecl>(D->getDeclContext());
// Allow 'this' within late-parsed attributes.
- Sema::CXXThisScopeRAII ThisScope(Actions, RD, Qualifiers(),
+ Sema::CXXThisScopeRAII ThisScope(Actions, RD, /*TypeQuals=*/0,
ND && ND->isCXXInstanceMember());
if (LA.Decls.size() == 1) {
@@ -6162,14 +6162,13 @@ void Parser::ParseFunctionDeclarator(Declarator &D,
: D.getContext() == DeclaratorContext::FileContext &&
D.getCXXScopeSpec().isValid() &&
Actions.CurContext->isRecord());
-
- Qualifiers Q = Qualifiers::fromCVRUMask(DS.getTypeQualifiers());
- if (D.getDeclSpec().isConstexprSpecified() && !getLangOpts().CPlusPlus14)
- Q.addConst();
-
- Sema::CXXThisScopeRAII ThisScope(
- Actions, dyn_cast<CXXRecordDecl>(Actions.CurContext), Q,
- IsCXX11MemberFunction);
+ Sema::CXXThisScopeRAII ThisScope(Actions,
+ dyn_cast<CXXRecordDecl>(Actions.CurContext),
+ DS.getTypeQualifiers() |
+ (D.getDeclSpec().isConstexprSpecified() &&
+ !getLangOpts().CPlusPlus14
+ ? Qualifiers::Const : 0),
+ IsCXX11MemberFunction);
// Parse exception-specification[opt].
bool Delayed = D.isFirstDeclarationOfMember() &&