[Bug c++/92771] [9/10 Regression] Concept won't use default template argument
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Dec 3 14:15:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92771
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced:
template<typename P, typename Arghhh = void>
concept one_or_two = true;
template<typename P>
concept one = one_or_two<P>;
template<typename T>
constexpr void
foo()
{
if (one<T>) // OK
{ }
if (one_or_two<T>) // ERROR
{ }
}
gcc-8-branch accepts this with -fconcepts.
gcc-9-branch rejects it with -fconcepts
92771.cc: In function 'constexpr void foo()':
92771.cc:14:20: error: expected unqualified-id before ')' token
14 | if (one_or_two<T>) // ERROR
| ^
trunk accepts with -fconcepts (?!?) but not with -std=gnu++2a:
92771.cc: In function 'constexpr void foo()':
92771.cc:14:7: error: expected 'auto' or 'decltype(auto)' after 'one_or_two<T>'
14 | if (one_or_two<T>) // ERROR
| ^~~~~~~~~~~~~
92771.cc:14:20: error: expected unqualified-id before ')' token
14 | if (one_or_two<T>) // ERROR
| ^
More information about the Gcc-bugs
mailing list