[llvm-branch-commits] [clang] [llvm] [clang] Define ptrauth_string_discriminator builtin. (PR #93903)

Anton Korobeynikov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jun 7 23:24:10 PDT 2024


================
@@ -47,6 +47,17 @@ void test_blend_discriminator(int *dp, int (*fp)(int), int value) {
   float *mismatch = __builtin_ptrauth_blend_discriminator(dp, value); // expected-error {{incompatible integer to pointer conversion initializing 'float *' with an expression of type}}
 }
 
+void test_string_discriminator(const char *str) {
+  __builtin_ptrauth_string_discriminator(); // expected-error {{too few arguments}}
+  __builtin_ptrauth_string_discriminator(str, str); // expected-error {{too many arguments}}
+  (void) __builtin_ptrauth_string_discriminator("test string"); // no warning
----------------
asl wrote:

Can we have `:"test string"` case here as well? As we're checking on the width of the literal character?

https://github.com/llvm/llvm-project/pull/93903


More information about the llvm-branch-commits mailing list