[clang] [CIR] Upstream namepsace handling (PR #137253)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 24 14:57:24 PDT 2025


================
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o - 2>&1 | FileCheck %s
+
+// Test anonymous namespace.
+namespace {
+  int g1 = 1;
+
+  // Note: This causes a warning about the function being undefined, but we
+  // currently have a problem with duplicate definitions when we call functions.
+  // This should be updated when that problem is fixed.
+  void f1(void);
----------------
erichkeane wrote:

The problem here is a function that cannot be defined, since the unnamed namespace results in no linkage, so you have a name that can be called now, but isn't defined.  Do you mean that once we fix the call-functions bug, that we can actually jsut toss a definition in here?

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


More information about the cfe-commits mailing list