https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124399
Bug ID: 124399
Summary: meta::annotations_of issue
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: hewillk at gmail dot com
Target Milestone: ---
#include <meta>
template<class T>
struct [[=42]] D { };
constexpr std::meta::info a1 = annotations_of(^^D<int>)[0];
constexpr std::meta::info a2 = annotations_of(^^D<char>)[0];
static_assert(a1 != a2);
static_assert(constant_of(a1) == constant_of(a2));
[[=1]] int x, y;
static_assert(annotations_of(^^x)[0] == annotations_of(^^y)[0]);
https://godbolt.org/z/v45sKbqah
The above should not be rejected because libstdc++ has already implemented
P3394R4 in
https://github.com/gcc-mirror/gcc/commit/4b0e94b394fa38cdc3431f3cfb333b85373bd948,
and these are valid examples in
https://eel.is/c++draft/meta.reflection#annotation-4.
Please let me know if I have missed anything.