public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94830] New: Some concepts diagnostic messages are nondeterministic
@ 2020-04-28 19:16 ppalka at gcc dot gnu.org
  2020-04-29  2:39 ` [Bug c++/94830] " ppalka at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-04-28 19:16 UTC (permalink / raw)
  To: gcc-bugs

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]"

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-29 13:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 19:16 [Bug c++/94830] New: Some concepts diagnostic messages are nondeterministic ppalka at gcc dot gnu.org
2020-04-29  2:39 ` [Bug c++/94830] " ppalka at gcc dot gnu.org
2020-04-29 13:07 ` cvs-commit at gcc dot gnu.org
2020-04-29 13:08 ` ppalka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).