[Bug c++/94830] New: Some concepts diagnostic messages are nondeterministic
ppalka at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Apr 28 19:16:30 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94830
Bug ID: 94830
Summary: Some concepts diagnostic messages are nondeterministic
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ppalka at gcc dot gnu.org
Target Milestone: ---
$ cat testcase.C
template<typename T, typename R>
concept c = __is_same(T, R);
template<typename T, typename R>
requires c<T,R>
void foo() { }
void bar()
{
foo<int, char>();
}
$ g++ -std=c++2a testcase.C
testcase.C: In function ‘void bar()’:
testcase.C:10:18: error: use of function ‘void foo() [with T = int; R = char]’
with unsatisfied constraints
10 | foo<int, char>();
| ^
testcase.C:6:6: note: declared here
6 | void foo() { }
| ^~~
testcase.C:6:6: note: constraints not satisfied
testcase.C: In instantiation of ‘void foo() [with T = int; R = char]’:
testcase.C:10:18: required from here
testcase.C:2:11: required for the satisfaction of ‘c<T, R>’ [with T = int; R
= char]
testcase.C:2:15: note: ‘int’ is not the same as ‘char’
2 | concept c = __is_same(T, R);
| ^~~~~~~~~~~~~~~
The diagnostic pointing to line 2:11 will on some invocations say "[with T =
int; R = char]" and on other invocations say "[with R = char; T = int]"
More information about the Gcc-bugs
mailing list