]> granicus.if.org Git - clang/commit
[CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(....
authorJustin Lebar <jlebar@google.com>
Fri, 30 Sep 2016 19:55:55 +0000 (19:55 +0000)
committerJustin Lebar <jlebar@google.com>
Fri, 30 Sep 2016 19:55:55 +0000 (19:55 +0000)
commitcbda4956da53c248f7de961afaa0bb6bfac50b2a
tree2f97b0f6ad8e69d64ca31aebb2ba5c88afe594e2
parent94575ae69a2e196fc9428b943967e17094bc8f4f
[CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(...)'.

Summary:
This is probably the sane place for the attribute to go, but nvcc
specifically rejects it.  Other GNU-style attributes are allowed in this
position (although judging from the warning it emits for
host/device/global, those attributes are applied to the lambda's
anonymous struct, not to the function itself).

It would be nice to have a FixIt message here, but doing so, or even
just getting the correct range for the attribute, including its '((' and
'))'s, is apparently Hard.

Reviewers: rnk

Subscribers: cfe-commits, tra

Differential Revision: https://reviews.llvm.org/D25115

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282911 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticParseKinds.td
lib/Parse/ParseExprCXX.cpp
test/Parser/lambda-attr.cu