[clang] e588d23 - Add back single quotes when dontcall attribute was split into dontcall-error/dontcall-warn

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 11 22:59:56 PST 2022


Author: Fangrui Song
Date: 2022-11-11T22:59:51-08:00
New Revision: e588d23a91fd28cd4218995a33c2a46fe721ff62

URL: https://github.com/llvm/llvm-project/commit/e588d23a91fd28cd4218995a33c2a46fe721ff62
DIFF: https://github.com/llvm/llvm-project/commit/e588d23a91fd28cd4218995a33c2a46fe721ff62.diff

LOG: Add back single quotes when dontcall attribute was split into dontcall-error/dontcall-warn

Single quotes were accidentally dropped in D110364.

Added: 
    

Modified: 
    clang/include/clang/Basic/DiagnosticFrontendKinds.td
    clang/test/Frontend/backend-attribute-error-warning-optimize.c
    clang/test/Frontend/backend-attribute-error-warning.c
    clang/test/Frontend/backend-attribute-error-warning.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/DiagnosticFrontendKinds.td b/clang/include/clang/Basic/DiagnosticFrontendKinds.td
index 1bd31ca2fc446..f0212ca7e9aca 100644
--- a/clang/include/clang/Basic/DiagnosticFrontendKinds.td
+++ b/clang/include/clang/Basic/DiagnosticFrontendKinds.td
@@ -86,9 +86,9 @@ def err_fe_backend_unsupported : Error<"%0">, BackendInfo;
 def warn_fe_backend_unsupported : Warning<"%0">, BackendInfo;
 
 def err_fe_backend_error_attr :
-  Error<"call to %0 declared with 'error' attribute: %1">, BackendInfo;
+  Error<"call to '%0' declared with 'error' attribute: %1">, BackendInfo;
 def warn_fe_backend_warning_attr :
-  Warning<"call to %0 declared with 'warning' attribute: %1">, BackendInfo,
+  Warning<"call to '%0' declared with 'warning' attribute: %1">, BackendInfo,
   InGroup<BackendWarningAttributes>;
 
 def err_fe_invalid_code_complete_file : Error<

diff  --git a/clang/test/Frontend/backend-attribute-error-warning-optimize.c b/clang/test/Frontend/backend-attribute-error-warning-optimize.c
index 668a0a4ca71f3..d3951e3b6b1f5 100644
--- a/clang/test/Frontend/backend-attribute-error-warning-optimize.c
+++ b/clang/test/Frontend/backend-attribute-error-warning-optimize.c
@@ -8,7 +8,7 @@ int x(void) {
   return 8 % 2 == 1;
 }
 void baz(void) {
-  foo(); // expected-error {{call to foo declared with 'error' attribute: oh no foo}}
+  foo(); // expected-error {{call to 'foo' declared with 'error' attribute: oh no foo}}
   if (x())
     bar();
 }

diff  --git a/clang/test/Frontend/backend-attribute-error-warning.c b/clang/test/Frontend/backend-attribute-error-warning.c
index a1450b46ba87d..c3c7803479aac 100644
--- a/clang/test/Frontend/backend-attribute-error-warning.c
+++ b/clang/test/Frontend/backend-attribute-error-warning.c
@@ -22,12 +22,12 @@ void                                            // expected-note at -1 {{previous a
 duplicate_warnings(void);
 
 void baz(void) {
-  foo(); // expected-error {{call to foo declared with 'error' attribute: oh no foo}}
+  foo(); // expected-error {{call to 'foo' declared with 'error' attribute: oh no foo}}
   if (x())
-    bar(); // expected-error {{call to bar declared with 'error' attribute: oh no bar}}
+    bar(); // expected-error {{call to 'bar' declared with 'error' attribute: oh no bar}}
 
-  quux();                     // enabled-warning {{call to quux declared with 'warning' attribute: oh no quux}}
-  __compiletime_assert_455(); // expected-error {{call to __compiletime_assert_455 declared with 'error' attribute: demangle me}}
-  duplicate_errors();         // expected-error {{call to duplicate_errors declared with 'error' attribute: two}}
-  duplicate_warnings();       // enabled-warning {{call to duplicate_warnings declared with 'warning' attribute: two}}
+  quux();                     // enabled-warning {{call to 'quux' declared with 'warning' attribute: oh no quux}}
+  __compiletime_assert_455(); // expected-error {{call to '__compiletime_assert_455' declared with 'error' attribute: demangle me}}
+  duplicate_errors();         // expected-error {{call to 'duplicate_errors' declared with 'error' attribute: two}}
+  duplicate_warnings();       // enabled-warning {{call to 'duplicate_warnings' declared with 'warning' attribute: two}}
 }

diff  --git a/clang/test/Frontend/backend-attribute-error-warning.cpp b/clang/test/Frontend/backend-attribute-error-warning.cpp
index 9e3fac8fcd7a6..1ed549c271241 100644
--- a/clang/test/Frontend/backend-attribute-error-warning.cpp
+++ b/clang/test/Frontend/backend-attribute-error-warning.cpp
@@ -23,14 +23,14 @@ void                                            // expected-note at -1 {{previous a
 duplicate_warnings(void);
 
 void baz(void) {
-  foo(); // expected-error {{call to foo() declared with 'error' attribute: oh no foo}}
+  foo(); // expected-error {{call to 'foo()' declared with 'error' attribute: oh no foo}}
   if (x())
-    bar(); // expected-error {{call to bar() declared with 'error' attribute: oh no bar}}
+    bar(); // expected-error {{call to 'bar()' declared with 'error' attribute: oh no bar}}
 
-  quux();                     // enabled-warning {{call to quux() declared with 'warning' attribute: oh no quux}}
-  __compiletime_assert_455(); // expected-error {{call to __compiletime_assert_455() declared with 'error' attribute: demangle me}}
-  duplicate_errors();         // expected-error {{call to duplicate_errors() declared with 'error' attribute: two}}
-  duplicate_warnings();       // enabled-warning {{call to duplicate_warnings() declared with 'warning' attribute: two}}
+  quux();                     // enabled-warning {{call to 'quux()' declared with 'warning' attribute: oh no quux}}
+  __compiletime_assert_455(); // expected-error {{call to '__compiletime_assert_455()' declared with 'error' attribute: demangle me}}
+  duplicate_errors();         // expected-error {{call to 'duplicate_errors()' declared with 'error' attribute: two}}
+  duplicate_warnings();       // enabled-warning {{call to 'duplicate_warnings()' declared with 'warning' attribute: two}}
 }
 
 #ifdef __cplusplus
@@ -45,16 +45,16 @@ struct Widget {
 };
 
 void baz_cpp(void) {
-  foo(); // expected-error {{call to foo() declared with 'error' attribute: oh no foo}}
+  foo(); // expected-error {{call to 'foo()' declared with 'error' attribute: oh no foo}}
   if (x())
-    bar(); // expected-error {{call to bar() declared with 'error' attribute: oh no bar}}
-  quux();  // enabled-warning {{call to quux() declared with 'warning' attribute: oh no quux}}
+    bar(); // expected-error {{call to 'bar()' declared with 'error' attribute: oh no bar}}
+  quux();  // enabled-warning {{call to 'quux()' declared with 'warning' attribute: oh no quux}}
 
   // Test that we demangle correctly in the diagnostic for C++.
-  __compiletime_assert_455(); // expected-error {{call to __compiletime_assert_455() declared with 'error' attribute: demangle me}}
-  nocall<int>(42);            // expected-error {{call to int nocall<int>(int) declared with 'error' attribute: demangle me, too}}
+  __compiletime_assert_455(); // expected-error {{call to '__compiletime_assert_455()' declared with 'error' attribute: demangle me}}
+  nocall<int>(42);            // expected-error {{call to 'int nocall<int>(int)' declared with 'error' attribute: demangle me, too}}
 
   Widget W;
-  int w = W; // enabled-warning {{Widget::operator int() declared with 'warning' attribute: don't call me!}}
+  int w = W; // enabled-warning {{call to 'Widget::operator int()' declared with 'warning' attribute: don't call me!}}
 }
 #endif


        


More information about the cfe-commits mailing list