[clang] [Parser][BoundsSafety] Print attribute as macro if it's system defined (PR #107619)
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 6 14:54:59 PDT 2024
================
@@ -14,12 +16,26 @@ void Func() {
auto NODEREF auto_i2 = i; // expected-warning{{'noderef' can only be used on an array or pointer type}}
}
+// The diagnostic message is hard-coded as 'noderef' so using a system macro doesn't change the behavior
+void Func_system_macro() {
+ int _SYS_NODEREF i; // expected-warning{{'noderef' can only be used on an array or pointer type}}
+ int _SYS_NODEREF *i_ptr;
+
+ auto _SYS_NODEREF *auto_i_ptr2 = i_ptr;
+ auto _SYS_NODEREF auto_i2 = i; // expected-warning{{'noderef' can only be used on an array or pointer type}}
+}
+
+
// Added test for fix for P41835
#define _LIBCPP_FLOAT_ABI __attribute__((pcs("aapcs")))
struct A {
_LIBCPP_FLOAT_ABI int operator()() throw(); // expected-warning{{'pcs' calling convention is not supported for this target}}
};
+struct A_system_macro {
+ _SYS_LIBCPP_FLOAT_ABI int operator()() throw(); // expected-warning{{'_SYS_LIBCPP_FLOAT_ABI' calling convention is not supported for this target}}
----------------
zygoloid wrote:
This seems to be losing important information -- it's no longer possible to tell from this diagnostic which calling convention was being applied / is not supported.
Can we add an "aka" for these cases, eg: `'_SYS_LIBCPP_FLOAT_ABI' (aka 'pcs') calling convention is not supported for this target`
https://github.com/llvm/llvm-project/pull/107619
More information about the cfe-commits
mailing list