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

            Bug ID: 81202
           Summary: Concept parsing error for default template arguments
           Product: gcc
           Version: 7.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kmp53 at sina dot com
  Target Milestone: ---

I found an parsing error for the default template parameter for Concept, and
the same syntax is correct in constexpr.

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 bool IsPtrC2=IsPtrC<T,AT>;
tple<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
}

Reply via email to