This revision was automatically updated to reflect the committed changes. Closed by commit rL282910: [CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on… (authored by jlebar).
Changed prior to commit: https://reviews.llvm.org/D25114?vs=73104&id=73122#toc Repository: rL LLVM https://reviews.llvm.org/D25114 Files: cfe/trunk/lib/Parse/ParseExprCXX.cpp Index: cfe/trunk/lib/Parse/ParseExprCXX.cpp =================================================================== --- cfe/trunk/lib/Parse/ParseExprCXX.cpp +++ cfe/trunk/lib/Parse/ParseExprCXX.cpp @@ -1128,12 +1128,10 @@ 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 @@ } 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 @@ 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.
Index: cfe/trunk/lib/Parse/ParseExprCXX.cpp =================================================================== --- cfe/trunk/lib/Parse/ParseExprCXX.cpp +++ cfe/trunk/lib/Parse/ParseExprCXX.cpp @@ -1128,12 +1128,10 @@ 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 @@ } 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 @@ 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.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits