summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-09-30 19:55:48 +0000
committerJustin Lebar <jlebar@google.com>2016-09-30 19:55:48 +0000
commit0139a5dcac495147cd11f7f2cba43398b3af122e (patch)
tree5c5497a3ccbc1dd9a442d49b9e32be27d7cd2aca /clang/lib
parentc11cdbae6f2b9840391f781b87cf59017b029ef3 (diff)
downloadbcm5719-llvm-0139a5dcac495147cd11f7f2cba43398b3af122e.tar.gz
bcm5719-llvm-0139a5dcac495147cd11f7f2cba43398b3af122e.zip
[CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on CUDA lambdas.
Summary: There's an overload that we can use to make this a bit cleaner. Reviewers: rnk Subscribers: cfe-commits, tra Differential Revision: https://reviews.llvm.org/D25114 llvm-svn: 282910
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Parse/ParseExprCXX.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp
index 2287e072730..7112b9e05f9 100644
--- a/clang/lib/Parse/ParseExprCXX.cpp
+++ b/clang/lib/Parse/ParseExprCXX.cpp
@@ -1128,12 +1128,10 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer(
ParsedAttributes Attr(AttrFactory);
SourceLocation DeclLoc = Tok.getLocation();
- SourceLocation DeclEndLoc = DeclLoc;
if (getLangOpts().CUDA) {
// In CUDA code, GNU attributes are allowed to appear immediately after the
// "[...]", even if there is no "(...)" before the lambda body.
- MaybeParseGNUAttributes(Attr, &DeclEndLoc);
- D.takeAttributes(Attr, DeclEndLoc);
+ MaybeParseGNUAttributes(D);
}
TypeResult TrailingReturnType;
@@ -1161,7 +1159,7 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer(
}
T.consumeClose();
SourceLocation RParenLoc = T.getCloseLocation();
- DeclEndLoc = RParenLoc;
+ SourceLocation DeclEndLoc = RParenLoc;
// GNU-style attributes must be parsed before the mutable specifier to be
// compatible with GCC.
@@ -1253,7 +1251,7 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer(
Diag(Tok, diag::err_lambda_missing_parens)
<< TokKind
<< FixItHint::CreateInsertion(Tok.getLocation(), "() ");
- DeclEndLoc = DeclLoc;
+ SourceLocation DeclEndLoc = DeclLoc;
// GNU-style attributes must be parsed before the mutable specifier to be
// compatible with GCC.
OpenPOWER on IntegriCloud