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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Full testcase:
#include <type_traits>
#include <tuple>

template<class T,class AT=void> constexpr bool
IsPtrC=std::is_pointer_v<T>&&(std::is_same_v<AT,void>
||std::is_same_v<AT,std::remove_pointer<T>>);
template<class T,class AT=void> concept  IsPtrC2=IsPtrC<T,AT>;
template<bool B> using TEST=int;
int main(int argc,char*argv[]){
  TEST<IsPtrC<int>> i;//OK
  TEST<IsPtrC2<int>> j;//error: parse error in template argument list
  TEST<IsPtrC2<int,void>> k;//OK
  TEST<(IsPtrC2<int>)> l;//OK
}


With -std=c++20 the above code works (as expected) but with -std=c++17
-fconcepts it fails (with GCC 10+).

I will let a C++ maintainer to decide if it should work with -std=c++17
-fconcepts or not.

The error message is:
<source>: In function 'int main(int, char**)':
<source>:10:19: error: type/value mismatch at argument 1 in template parameter
list for 'template<bool B> using TEST = int'
   10 |   TEST<IsPtrC2<int>> j;//error: parse error in template argument list
      |                   ^~
<source>:10:19: note:   expected a constant of type 'bool', got 'auto [requires
IsPtrC2<<placeholder>, int>]'
Compiler returned: 1

Reply via email to