[Bug c++/124686] New: CTAD using typename is incorrectly rejected

luigighiron at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Mar 29 21:00:55 GMT 2026


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

            Bug ID: 124686
           Summary: CTAD using typename is incorrectly rejected
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: luigighiron at gmail dot com
  Target Milestone: ---

The following code is incorrectly rejected by GCC:

template<typename T>struct foo{
    T x;
};
struct bar{
    template<typename T>using baz=foo<T>;
};
int main(){
    typename bar::baz v{0};
}

This is a valid usage of CTAD, typename is allowed but not required. Clang,
MSVC, and EDG accept this code.


More information about the Gcc-bugs mailing list