public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95303] New: Member type of class template is incorrectly printed in diagnostics when it fails to satisfy a concept
@ 2020-05-24 10:20 ensadc at mailnesia dot com
2020-05-28 3:06 ` [Bug c++/95303] [concepts] " ppalka at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: ensadc at mailnesia dot com @ 2020-05-24 10:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95303
Bug ID: 95303
Summary: Member type of class template is incorrectly printed
in diagnostics when it fails to satisfy a concept
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ensadc at mailnesia dot com
CC: asutton at gcc dot gnu.org
Target Milestone: ---
https://godbolt.org/z/F5Hj38
====
template<class>
struct A {
struct B {};
};
template<class T>
concept C = requires (T&& t) {
t.a;
};
static_assert(C<A<int>::B>);
====
<source>:11:15: error: static assertion failed
11 | static_assert(C<A<int>::B>);
| ^~~~~~~~~~~~
<source>:11:15: note: constraints not satisfied
<source>:7:9: required by the constraints of 'template<class T> concept C'
<source>:7:13: in requirements with 'T&& t' [with T = A<int>::B<int>]
<source>:8:7: note: the required expression 't.a' is invalid
8 | t.a;
| ~~^
cc1plus: note: set '-fconcepts-diagnostics-depth=' to at least 2 for more
detail
====
Note '[with T = A<int>::B<int>]'. It should be '[with T = A<int>::B]', without
the second `<int>`.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/95303] [concepts] Member type of class template is incorrectly printed in diagnostics when it fails to satisfy a concept
2020-05-24 10:20 [Bug c++/95303] New: Member type of class template is incorrectly printed in diagnostics when it fails to satisfy a concept ensadc at mailnesia dot com
@ 2020-05-28 3:06 ` ppalka at gcc dot gnu.org
2020-07-06 20:54 ` ppalka at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-05-28 3:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95303
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |10.0, 11.0
Last reconfirmed| |2020-05-28
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
CC| |ppalka at gcc dot gnu.org
--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/95303] [concepts] Member type of class template is incorrectly printed in diagnostics when it fails to satisfy a concept
2020-05-24 10:20 [Bug c++/95303] New: Member type of class template is incorrectly printed in diagnostics when it fails to satisfy a concept ensadc at mailnesia dot com
2020-05-28 3:06 ` [Bug c++/95303] [concepts] " ppalka at gcc dot gnu.org
@ 2020-07-06 20:54 ` ppalka at gcc dot gnu.org
2020-07-07 20:33 ` cvs-commit at gcc dot gnu.org
2020-07-07 20:34 ` ppalka at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-07-06 20:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95303
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/95303] [concepts] Member type of class template is incorrectly printed in diagnostics when it fails to satisfy a concept
2020-05-24 10:20 [Bug c++/95303] New: Member type of class template is incorrectly printed in diagnostics when it fails to satisfy a concept ensadc at mailnesia dot com
2020-05-28 3:06 ` [Bug c++/95303] [concepts] " ppalka at gcc dot gnu.org
2020-07-06 20:54 ` ppalka at gcc dot gnu.org
@ 2020-07-07 20:33 ` cvs-commit at gcc dot gnu.org
2020-07-07 20:34 ` ppalka at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-07 20:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95303
--- Comment #2 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:9845b7b45621e3833aee47276cb111e43be0e48b
commit r11-1903-g9845b7b45621e3833aee47276cb111e43be0e48b
Author: Patrick Palka <ppalka@redhat.com>
Date: Tue Jul 7 16:33:12 2020 -0400
c++: wrong pretty printing of nested type [PR95303]
In the testcase below, we pretty print the nested type A<int>::B as
A<int>::B<int> because we don't check whether B is itself a class
template before printing the innermost set of template arguments from
B's TEMPLATE_INFO (which in this case belong to A). This patch fixes
this by checking PRIMARY_TEMPLATE_P beforehand.
gcc/cp/ChangeLog:
PR c++/95303
* cxx-pretty-print.c (pp_cxx_unqualified_id): Check
PRIMARY_TEMPLATE_P before printing the innermost template
arguments.
gcc/testsuite/ChangeLog:
PR c++/95303
* g++.dg/concepts/diagnostic14.C: New test.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/95303] [concepts] Member type of class template is incorrectly printed in diagnostics when it fails to satisfy a concept
2020-05-24 10:20 [Bug c++/95303] New: Member type of class template is incorrectly printed in diagnostics when it fails to satisfy a concept ensadc at mailnesia dot com
` (2 preceding siblings ...)
2020-07-07 20:33 ` cvs-commit at gcc dot gnu.org
@ 2020-07-07 20:34 ` ppalka at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-07-07 20:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95303
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.0
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 11.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-07-07 20:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-24 10:20 [Bug c++/95303] New: Member type of class template is incorrectly printed in diagnostics when it fails to satisfy a concept ensadc at mailnesia dot com
2020-05-28 3:06 ` [Bug c++/95303] [concepts] " ppalka at gcc dot gnu.org
2020-07-06 20:54 ` ppalka at gcc dot gnu.org
2020-07-07 20:33 ` cvs-commit at gcc dot gnu.org
2020-07-07 20:34 ` 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).