[Bug c++/96363] New: bogus error with constrained partial specialization

nathan at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jul 28 21:50:30 GMT 2020


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

            Bug ID: 96363
           Summary: bogus error with constrained partial specialization
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nathan at gcc dot gnu.org
  Target Milestone: ---

template <typename T> class TPL;

template <typename T> struct Trait;

template <typename T>
  requires (Trait<T>::val == 0)
class TPL<T>;  // #1

template <typename T>
  requires (Trait<T>::val == 1)
class TPL<T>;  // #2 error here

cc1plus -quiet -std=c++20 par.cc 
par.cc:11:7: error: ‘TPL<T>’ does not match original declaration
   11 | class TPL<T>;
      |       ^~~~~~
par.cc:1:29: note: original template declaration here
    1 | template <typename T> class TPL;
      |                             ^~~

ICBW, but if #2 is rejected, why is #1 accepted.  Aren't these just two partial
specializations with different constraints?


More information about the Gcc-bugs mailing list