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
* [Bug c++/94830] Some concepts diagnostic messages are nondeterministic 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 ` 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 2 siblings, 0 replies; 4+ messages in thread From: ppalka at gcc dot gnu.org @ 2020-04-29 2:39 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94830 Patrick Palka <ppalka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2020-04-29 Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org Ever confirmed|0 |1 Status|UNCONFIRMED |ASSIGNED ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/94830] Some concepts diagnostic messages are nondeterministic 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 2 siblings, 0 replies; 4+ messages in thread From: cvs-commit at gcc dot gnu.org @ 2020-04-29 13:07 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94830 --- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>: https://gcc.gnu.org/g:a7201a085cc30f89944931d8fb1d7936f02a169f commit r10-8049-ga7201a085cc30f89944931d8fb1d7936f02a169f Author: Patrick Palka <ppalka@redhat.com> Date: Wed Apr 29 09:04:58 2020 -0400 c++: Nondeterministic concepts diagnostics [PR94830] This patch makes the order in which template parameters appear in the TREE_LIST returned by find_template_parameters deterministic between runs. The current nondeterminism is semantically harmless, but it has the undesirable effect of causing some concepts diagnostics which print a constraint's parameter mapping via pp_cxx_parameter_mapping to also be nondeterministic, as in the testcases below. gcc/cp/ChangeLog: PR c++/94830 * pt.c (find_template_parameter_info::parm_list): New field. (keep_template_parm): Use the new field to build up the parameter list here instead of ... (find_template_parameters): ... here. Return ftpi.parm_list. gcc/testsuite/ChangeLog: PR c++/94830 * g++.dg/concepts/diagnostics12.C: Clarify the dg-message now that the corresponding diagnostic is deterministic. * g++.dg/concepts/diagnostics13.C: New test. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/94830] Some concepts diagnostic messages are nondeterministic 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 2 siblings, 0 replies; 4+ messages in thread From: ppalka at gcc dot gnu.org @ 2020-04-29 13:08 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94830 Patrick Palka <ppalka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Target Milestone|--- |10.0 Status|ASSIGNED |RESOLVED --- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> --- Fixed. ^ 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).