[clang] [Clang] Permit noescape on non-pointer types (PR #117344)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 2 05:49:18 PST 2024


================
@@ -1,7 +1,12 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
+// expected-no-diagnostics
+
 template<typename T>
 void test1(T __attribute__((noescape)) arr, int size);
 
-// expected-warning at +1 {{'noescape' attribute only applies to pointer arguments}}
-void test2(int __attribute__((noescape)) arr, int size);
\ No newline at end of file
+void test2(int __attribute__((noescape)) arr, int size);
+
+#if !__has_feature(attribute_noescape_nonpointer)
----------------
Xazax-hun wrote:

This PR introduced this feature and the goal of this test to make sure feature testing works as expected. I am happy to remove the test if you find it redundant. 

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


More information about the cfe-commits mailing list