[clang] [clang]: support std::meta::info for primitive types (PR #190356)

Daniel M. Katz via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 4 08:32:17 PDT 2026


================
@@ -1,6 +1,10 @@
 // RUN: %clang_cc1 -std=c++26 -freflection -triple x86_64-unknown-linux-gnu \
 // RUN:   -emit-llvm -o - %s -verify
 
+constexpr auto r = ^^int;
+constexpr auto q = r;
----------------
katzdm wrote:

Yes, variables of consteval-only type can have static storage duration and can even be odr-used. The caveat is that all such expressions that odr-use them must be in an immediate function context, such that the implementation can still just elide them from codegen.

But their external linkage means that such a variable could, for instance, be imported across module boundaries. Suitable restrictions to keep e.g., a reflection of a function with internal linkage from being exported are encoded by classifying certain reflections as TU-local values ([basic.link]/16.4).

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


More information about the cfe-commits mailing list