[clang] [Clang] Fix crash involving `__attribute__((cleanup))` attributes and improve handling of multiple `cleanup` attributes (PR #207785)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 7 10:52:38 PDT 2026
================
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -std=c11 -triple x86_64-unknown-linux -verify -fsyntax-only %s
+
+// Check that a cleanup attribute on an invalid declaration doesn't crash,
+// and that we diagnose duplicate cleanup attributes.
+
+#define C(x) __attribute__((cleanup(x)))
+void foo(double *x U) {} // expected-error {{expected ')'}} expected-note {{to match this '('}}
----------------
Sirraide wrote:
The parameter of `foo`, no. The variable with the attribute, yes, because the issue is that the type of the declaration is null.
https://github.com/llvm/llvm-project/pull/207785
More information about the cfe-commits
mailing list