[clang] [clang][AST] fix ast-print of `extern <lang>` with >=2 declarators (PR #93131)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Thu May 23 09:27:25 PDT 2024
================
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -ast-print %s -o - | FileCheck %s
+
+// CHECK: extern "C" int printf(const char *, ...);
+extern "C" int printf(const char *...);
+
+// CHECK: extern "C++" {
+// CHECK-NEXT: int f(int);
+// CHECK-NEXT: int g(int);
+// CHECK-NEXT: }
+extern "C++" int f(int), g(int);
+
+// CHECK: extern "C" {
+// CHECK-NEXT: void foo();
+// CHECK-NEXT: int x;
+// CHECK-NEXT: int y;
+// CHECK-NEXT: }
+extern "C" {
+ void foo(void);
+ int x, y;
----------------
erichkeane wrote:
I see, yeah, I think this is fine then. Same with the functions, but I'll give Aaron a chance to comment.
https://github.com/llvm/llvm-project/pull/93131
More information about the cfe-commits
mailing list