https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124961

            Bug ID: 124961
           Summary: [reflection] Cannot use CTAD with
                    splice-type-specifier
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ensadc at mailnesia dot com
  Target Milestone: ---

https://gcc.godbolt.org/z/zGfEvWvEb
====
template<class T>
struct A { int x; };

constexpr auto x = ^^A;

[:x:] a{0}; // error: expected unqualified-id before '[:' token

auto test() {
    return typename[:x:]{0}; // error: expected primary-expression before
'typename'
}

====
Compiling above with '-std=c++26 -freflection' leads to various syntax errors.

N5032 [dcl.type.simple]/3 and [over.match.class.deduct] seem to indicate that
CTAD should work with (non-dependent) *splice-type-specifier*.

Reply via email to