[clang] 6aa80f0 - [Clang] [NFC] Add single quotes around __builtin_bit_cast (#116120)

via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 19 01:16:51 PST 2024


Author: Oleksandr T.
Date: 2024-11-19T10:16:47+01:00
New Revision: 6aa80f00574826a0c2f2972a659517a9bf1efece

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

LOG: [Clang] [NFC] Add single quotes around __builtin_bit_cast (#116120)

Fixes #116118

Added: 
    

Modified: 
    clang/include/clang/Basic/DiagnosticSemaKinds.td
    clang/test/SemaCXX/builtin-bit-cast.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 3caf471d3037f9..ad2a932ca463ec 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -12366,7 +12366,7 @@ def err_preserve_enum_value_not_const: Error<
   "__builtin_preserve_enum_value argument %0 not a constant">;
 
 def err_bit_cast_non_trivially_copyable : Error<
-  "__builtin_bit_cast %select{source|destination}0 type must be trivially copyable">;
+  "'__builtin_bit_cast' %select{source|destination}0 type must be trivially copyable">;
 def err_bit_cast_type_size_mismatch : Error<
   "size of '__builtin_bit_cast' source type %0 does not match destination type %1 (%2 vs %3 bytes)">;
 

diff  --git a/clang/test/SemaCXX/builtin-bit-cast.cpp b/clang/test/SemaCXX/builtin-bit-cast.cpp
index d7f24c7939b558..8717371b941b0d 100644
--- a/clang/test/SemaCXX/builtin-bit-cast.cpp
+++ b/clang/test/SemaCXX/builtin-bit-cast.cpp
@@ -32,10 +32,10 @@ struct not_trivially_copyable {
   virtual void foo() {}
 };
 
-// expected-error at +1{{__builtin_bit_cast source type must be trivially copyable}}
+// expected-error at +1{{'__builtin_bit_cast' source type must be trivially copyable}}
 constexpr unsigned long ul = __builtin_bit_cast(unsigned long, not_trivially_copyable{});
 
-// expected-error at +1 {{__builtin_bit_cast destination type must be trivially copyable}}
+// expected-error at +1 {{'__builtin_bit_cast' destination type must be trivially copyable}}
 constexpr long us = __builtin_bit_cast(unsigned long &, 0L);
 
 namespace PR42936 {


        


More information about the cfe-commits mailing list