[clang] [clang-repl] Emit const variables only once (PR #65257)

Jonas Hahnfeld via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 3 01:19:30 PDT 2023


================
@@ -0,0 +1,29 @@
+// UNSUPPORTED: system-aix
+// RUN: cat %s | clang-repl | FileCheck %s
+// RUN: cat %s | clang-repl -Xcc -O2 | FileCheck %s
+
+extern "C" int printf(const char*, ...);
+
----------------
hahnjo wrote:

`const A a(1);` is a file-scope constant, no? We don't need it for C because the special case in `LinkageComputer::getLVForNamespaceScopeDecl` only applies to C++ (my understanding is that `const` variables always have an identity in C).

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


More information about the cfe-commits mailing list