[Bug c++/105268] New: type/value mismatch when using variadic concept
barry.revzin at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Apr 13 23:05:44 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105268
Bug ID: 105268
Summary: type/value mismatch when using variadic concept
Product: gcc
Version: 11.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: barry.revzin at gmail dot com
Target Milestone: ---
>From StackOverflow (https://stackoverflow.com/q/71864544/2069064):
template<typename> concept C_one = true;
template<typename...> concept C_many = true;
template<bool B> struct S { };
template<typename T = S<C_one<int>>> void f(); // ok
template<typename T = S<C_many<int>>> void g(); // error
gcc rejects the declaration of g with:
<source>:7:35: error: type/value mismatch at argument 1 in template parameter
list for 'template<bool B> struct S'
7 | template<typename T = S<C_many<int>>> void g();
| ^~
<source>:7:35: note: expected a constant of type 'bool', got
'<template-parameter-1-1>'
But C_many<int> is a bool, so this should be fine. And template-parameter-1-1
isn't a very useful diagnostic anyway.
More information about the Gcc-bugs
mailing list