benshi001 created this revision.
benshi001 added reviewers: tra, fodinabor, Hahnfeld, yaxunl.
benshi001 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112521

Files:
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/test/Parser/lambda-attr.cu


Index: clang/test/Parser/lambda-attr.cu
===================================================================
--- clang/test/Parser/lambda-attr.cu
+++ clang/test/Parser/lambda-attr.cu
@@ -6,36 +6,36 @@
 
 __attribute__((device)) void device_attr() {
   ([]() __attribute__((device)) { device_fn(); })();
-  // expected-warning@-1 {{nvcc does not allow '__device__' to appear after 
'()' in lambdas}}
+  // expected-warning@-1 {{nvcc does not allow '__device__' to appear after 
the parameter list in lambdas}}
   ([] __attribute__((device)) () { device_fn(); })();
   ([] __attribute__((device)) { device_fn(); })();
 
   ([&]() __attribute__((device)){ device_fn(); })();
-  // expected-warning@-1 {{nvcc does not allow '__device__' to appear after 
'()' in lambdas}}
+  // expected-warning@-1 {{nvcc does not allow '__device__' to appear after 
the parameter list in lambdas}}
   ([&] __attribute__((device)) () { device_fn(); })();
   ([&] __attribute__((device)) { device_fn(); })();
 
   ([&](int) __attribute__((device)){ device_fn(); })(0);
-  // expected-warning@-1 {{nvcc does not allow '__device__' to appear after 
'()' in lambdas}}
+  // expected-warning@-1 {{nvcc does not allow '__device__' to appear after 
the parameter list in lambdas}}
   ([&] __attribute__((device)) (int) { device_fn(); })(0);
 }
 
 __attribute__((host)) __attribute__((device)) void host_device_attrs() {
   ([]() __attribute__((host)) __attribute__((device)){ hd_fn(); })();
-  // expected-warning@-1 {{nvcc does not allow '__host__' to appear after '()' 
in lambdas}}
-  // expected-warning@-2 {{nvcc does not allow '__device__' to appear after 
'()' in lambdas}}
+  // expected-warning@-1 {{nvcc does not allow '__host__' to appear after the 
parameter list in lambdas}}
+  // expected-warning@-2 {{nvcc does not allow '__device__' to appear after 
the parameter list in lambdas}}
   ([] __attribute__((host)) __attribute__((device)) () { hd_fn(); })();
   ([] __attribute__((host)) __attribute__((device)) { hd_fn(); })();
 
   ([&]() __attribute__((host)) __attribute__((device)){ hd_fn(); })();
-  // expected-warning@-1 {{nvcc does not allow '__host__' to appear after '()' 
in lambdas}}
-  // expected-warning@-2 {{nvcc does not allow '__device__' to appear after 
'()' in lambdas}}
+  // expected-warning@-1 {{nvcc does not allow '__host__' to appear after the 
parameter list in lambdas}}
+  // expected-warning@-2 {{nvcc does not allow '__device__' to appear after 
the parameter list in lambdas}}
   ([&] __attribute__((host)) __attribute__((device)) () { hd_fn(); })();
   ([&] __attribute__((host)) __attribute__((device)) { hd_fn(); })();
 
   ([&](int) __attribute__((host)) __attribute__((device)){ hd_fn(); })(0);
-  // expected-warning@-1 {{nvcc does not allow '__host__' to appear after '()' 
in lambdas}}
-  // expected-warning@-2 {{nvcc does not allow '__device__' to appear after 
'()' in lambdas}}
+  // expected-warning@-1 {{nvcc does not allow '__host__' to appear after the 
parameter list in lambdas}}
+  // expected-warning@-2 {{nvcc does not allow '__device__' to appear after 
the parameter list in lambdas}}
   ([&] __attribute__((host)) __attribute__((device)) (int) { hd_fn(); })(0);
 }
 
Index: clang/include/clang/Basic/DiagnosticParseKinds.td
===================================================================
--- clang/include/clang/Basic/DiagnosticParseKinds.td
+++ clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -1495,7 +1495,7 @@
   InGroup<CudaCompat>;
 
 def warn_cuda_attr_lambda_position : Warning<
-  "nvcc does not allow '__%0__' to appear after '()' in lambdas">,
+  "nvcc does not allow '__%0__' to appear after the parameter list in 
lambdas">,
   InGroup<CudaCompat>;
 def warn_pragma_force_cuda_host_device_bad_arg : Warning<
   "incorrect use of #pragma clang force_cuda_host_device begin|end">,


Index: clang/test/Parser/lambda-attr.cu
===================================================================
--- clang/test/Parser/lambda-attr.cu
+++ clang/test/Parser/lambda-attr.cu
@@ -6,36 +6,36 @@
 
 __attribute__((device)) void device_attr() {
   ([]() __attribute__((device)) { device_fn(); })();
-  // expected-warning@-1 {{nvcc does not allow '__device__' to appear after '()' in lambdas}}
+  // expected-warning@-1 {{nvcc does not allow '__device__' to appear after the parameter list in lambdas}}
   ([] __attribute__((device)) () { device_fn(); })();
   ([] __attribute__((device)) { device_fn(); })();
 
   ([&]() __attribute__((device)){ device_fn(); })();
-  // expected-warning@-1 {{nvcc does not allow '__device__' to appear after '()' in lambdas}}
+  // expected-warning@-1 {{nvcc does not allow '__device__' to appear after the parameter list in lambdas}}
   ([&] __attribute__((device)) () { device_fn(); })();
   ([&] __attribute__((device)) { device_fn(); })();
 
   ([&](int) __attribute__((device)){ device_fn(); })(0);
-  // expected-warning@-1 {{nvcc does not allow '__device__' to appear after '()' in lambdas}}
+  // expected-warning@-1 {{nvcc does not allow '__device__' to appear after the parameter list in lambdas}}
   ([&] __attribute__((device)) (int) { device_fn(); })(0);
 }
 
 __attribute__((host)) __attribute__((device)) void host_device_attrs() {
   ([]() __attribute__((host)) __attribute__((device)){ hd_fn(); })();
-  // expected-warning@-1 {{nvcc does not allow '__host__' to appear after '()' in lambdas}}
-  // expected-warning@-2 {{nvcc does not allow '__device__' to appear after '()' in lambdas}}
+  // expected-warning@-1 {{nvcc does not allow '__host__' to appear after the parameter list in lambdas}}
+  // expected-warning@-2 {{nvcc does not allow '__device__' to appear after the parameter list in lambdas}}
   ([] __attribute__((host)) __attribute__((device)) () { hd_fn(); })();
   ([] __attribute__((host)) __attribute__((device)) { hd_fn(); })();
 
   ([&]() __attribute__((host)) __attribute__((device)){ hd_fn(); })();
-  // expected-warning@-1 {{nvcc does not allow '__host__' to appear after '()' in lambdas}}
-  // expected-warning@-2 {{nvcc does not allow '__device__' to appear after '()' in lambdas}}
+  // expected-warning@-1 {{nvcc does not allow '__host__' to appear after the parameter list in lambdas}}
+  // expected-warning@-2 {{nvcc does not allow '__device__' to appear after the parameter list in lambdas}}
   ([&] __attribute__((host)) __attribute__((device)) () { hd_fn(); })();
   ([&] __attribute__((host)) __attribute__((device)) { hd_fn(); })();
 
   ([&](int) __attribute__((host)) __attribute__((device)){ hd_fn(); })(0);
-  // expected-warning@-1 {{nvcc does not allow '__host__' to appear after '()' in lambdas}}
-  // expected-warning@-2 {{nvcc does not allow '__device__' to appear after '()' in lambdas}}
+  // expected-warning@-1 {{nvcc does not allow '__host__' to appear after the parameter list in lambdas}}
+  // expected-warning@-2 {{nvcc does not allow '__device__' to appear after the parameter list in lambdas}}
   ([&] __attribute__((host)) __attribute__((device)) (int) { hd_fn(); })(0);
 }
 
Index: clang/include/clang/Basic/DiagnosticParseKinds.td
===================================================================
--- clang/include/clang/Basic/DiagnosticParseKinds.td
+++ clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -1495,7 +1495,7 @@
   InGroup<CudaCompat>;
 
 def warn_cuda_attr_lambda_position : Warning<
-  "nvcc does not allow '__%0__' to appear after '()' in lambdas">,
+  "nvcc does not allow '__%0__' to appear after the parameter list in lambdas">,
   InGroup<CudaCompat>;
 def warn_pragma_force_cuda_host_device_bad_arg : Warning<
   "incorrect use of #pragma clang force_cuda_host_device begin|end">,
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to