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

            Bug ID: 92103
           Summary: constraints not checked on nested class template
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
            Blocks: 67491
  Target Milestone: ---

template<typename T>
struct traits
{
  template<typename U>
    struct nested
    { using type = void; };

  template<typename U> requires requires { typename U::type; }
    struct nested<U>
    { using type = typename U::type; };
};

using V = traits<char>::nested<int>::type;


Fails to compile with -std=gnu++2a

nest.cc: In instantiation of 'struct traits<char>::nested<int>':
nest.cc:13:35:   required from here
nest.cc:10:13: error: 'int' is not a class, struct, or union type
   10 |     { using type = typename U::type; };
      |             ^~~~


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
[Bug 67491] [meta-bug] concepts issues

Reply via email to