[clang] [Clang] Fix crash involving `__attribute__((cleanup))` attributes and improve handling of multiple `cleanup` attributes (PR #207785)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 8 06:24:26 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 '('}}
----------------
AaronBallman wrote:
That's what I figured; I'd drop the `U` here so this is a valid function definition.
https://github.com/llvm/llvm-project/pull/207785
More information about the cfe-commits
mailing list