* [Bug c++/98355] [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628
2020-12-17 16:51 [Bug c++/98355] New: [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628 gscfq@t-online.de
@ 2020-12-17 17:25 ` msebor at gcc dot gnu.org
2021-01-05 8:34 ` rguenth at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-12-17 17:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98355
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=90915,
| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=92104
CC| |msebor at gcc dot gnu.org
Last reconfirmed| |2020-12-17
Status|UNCONFIRMED |NEW
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
The built-in (still) isn't implemented for templates. See also pr90915 (and
pr92104). There's little value in raising new reports for this or in changing
the ICE to Sorry.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/98355] [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628
2020-12-17 16:51 [Bug c++/98355] New: [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628 gscfq@t-online.de
2020-12-17 17:25 ` [Bug c++/98355] " msebor at gcc dot gnu.org
@ 2021-01-05 8:34 ` rguenth at gcc dot gnu.org
2021-01-14 11:13 ` rguenth at gcc dot gnu.org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-05 8:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98355
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |9.4
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
sorry() informs the user that the issue is known and not an "internal compiler
error" so I disagree
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/98355] [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628
2020-12-17 16:51 [Bug c++/98355] New: [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628 gscfq@t-online.de
2020-12-17 17:25 ` [Bug c++/98355] " msebor at gcc dot gnu.org
2021-01-05 8:34 ` rguenth at gcc dot gnu.org
@ 2021-01-14 11:13 ` rguenth at gcc dot gnu.org
2021-01-19 14:59 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-14 11:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98355
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/98355] [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628
2020-12-17 16:51 [Bug c++/98355] New: [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628 gscfq@t-online.de
` (2 preceding siblings ...)
2021-01-14 11:13 ` rguenth at gcc dot gnu.org
@ 2021-01-19 14:59 ` jakub at gcc dot gnu.org
2021-01-19 16:33 ` msebor at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-19 14:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98355
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Agreed, but I'd also say that it shouldn't have been accepted without the
template support, because templates are essential part of the C++ language and
so not supporting templates means C++ isn't really supported. Design of all
the C++ FE features needs to take templates into account.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/98355] [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628
2020-12-17 16:51 [Bug c++/98355] New: [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628 gscfq@t-online.de
` (3 preceding siblings ...)
2021-01-19 14:59 ` jakub at gcc dot gnu.org
@ 2021-01-19 16:33 ` msebor at gcc dot gnu.org
2021-01-29 4:41 ` mpolacek at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-01-19 16:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98355
--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
I had stated my intent in the initial submission to complete the C++ support in
a followup patch:
https://gcc.gnu.org/pipermail/gcc-patches/2018-November/510455.html
Jason approved the initial patch with an encouragement to do so:
https://gcc.gnu.org/legacy-ml/gcc-patches/2018-10/msg01528.html
I might have gotten around to it if you and Jeff hadn't blocked for four months
(!) my fixes for a few simple ICEs in the code. Here's the first submission of
a patch for the first ICE I found in December 2018:
https://gcc.gnu.org/pipermail/gcc-patches/2018-December/512645.html
The fixes didn't get approved and committed in r270326 until April 2019, and
many rounds of back and forth bickering over whether the built-in should accept
expressions or error out on them.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/98355] [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628
2020-12-17 16:51 [Bug c++/98355] New: [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628 gscfq@t-online.de
` (4 preceding siblings ...)
2021-01-19 16:33 ` msebor at gcc dot gnu.org
@ 2021-01-29 4:41 ` mpolacek at gcc dot gnu.org
2021-01-29 16:34 ` mpolacek at gcc dot gnu.org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-01-29 4:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98355
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
My earlier fix to emit sorry rather than ICE didn't catch this case; this patch
fixes that:
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -8934,7 +8934,7 @@ cp_parser_has_attribute_expression (cp_parser *parser)
{
if (oper == error_mark_node)
/* Nothing. */;
- else if (type_dependent_expression_p (oper))
+ else if (uses_template_parms (oper))
sorry_at (atloc, "%<__builtin_has_attribute%> with dependent argument "
"not supported yet");
else
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/98355] [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628
2020-12-17 16:51 [Bug c++/98355] New: [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628 gscfq@t-online.de
` (5 preceding siblings ...)
2021-01-29 4:41 ` mpolacek at gcc dot gnu.org
@ 2021-01-29 16:34 ` mpolacek at gcc dot gnu.org
2021-02-01 15:21 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-01-29 16:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98355
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/98355] [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628
2020-12-17 16:51 [Bug c++/98355] New: [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628 gscfq@t-online.de
` (6 preceding siblings ...)
2021-01-29 16:34 ` mpolacek at gcc dot gnu.org
@ 2021-02-01 15:21 ` cvs-commit at gcc dot gnu.org
2021-02-01 15:22 ` [Bug c++/98355] [9/10 " mpolacek at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-01 15:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98355
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:bab669f2fc643cb1673aecd177eec1c773e9e48e
commit r11-7012-gbab669f2fc643cb1673aecd177eec1c773e9e48e
Author: Marek Polacek <polacek@redhat.com>
Date: Fri Jan 29 11:29:25 2021 -0500
c++: Improve sorry for __builtin_has_attribute [PR98355]
__builtin_has_attribute doesn't work in templates yet (bug 92104), so
in r11-471 I added a sorry. But that only caught type-dependent
expressions and we also want to sorry on value-dependent expressions.
This patch uses uses_template_parms, but guarded with p_t_d, because
u_t_p sets p_t_d and then v_d_e_p considers variables with reference
types value-dependent, which breaks builtin-has-attribute-6.c.
This is a regression and I also plan to apply this to gcc-10.
gcc/cp/ChangeLog:
PR c++/98355
* parser.c (cp_parser_has_attribute_expression): Use
uses_template_parms instead of type_dependent_expression_p.
gcc/testsuite/ChangeLog:
PR c++/98355
* g++.dg/ext/builtin-has-attribute2.C: New test.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/98355] [9/10 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628
2020-12-17 16:51 [Bug c++/98355] New: [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628 gscfq@t-online.de
` (7 preceding siblings ...)
2021-02-01 15:21 ` cvs-commit at gcc dot gnu.org
@ 2021-02-01 15:22 ` mpolacek at gcc dot gnu.org
2021-02-01 15:23 ` cvs-commit at gcc dot gnu.org
2021-02-01 15:23 ` [Bug c++/98355] [9 " mpolacek at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-02-01 15:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98355
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[9/10/11 Regression] ICE in |[9/10 Regression] ICE in
|has_attribute, at |has_attribute, at
|c-family/c-attribs.c:5628 |c-family/c-attribs.c:5628
--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed on trunk thus far.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/98355] [9/10 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628
2020-12-17 16:51 [Bug c++/98355] New: [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628 gscfq@t-online.de
` (8 preceding siblings ...)
2021-02-01 15:22 ` [Bug c++/98355] [9/10 " mpolacek at gcc dot gnu.org
@ 2021-02-01 15:23 ` cvs-commit at gcc dot gnu.org
2021-02-01 15:23 ` [Bug c++/98355] [9 " mpolacek at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-01 15:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98355
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Marek Polacek
<mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:c616e86e8bc76f867242b4aba372736d1c8cbf80
commit r10-9332-gc616e86e8bc76f867242b4aba372736d1c8cbf80
Author: Marek Polacek <polacek@redhat.com>
Date: Fri Jan 29 11:29:25 2021 -0500
c++: Improve sorry for __builtin_has_attribute [PR98355]
__builtin_has_attribute doesn't work in templates yet (bug 92104), so
in r11-471 I added a sorry. But that only caught type-dependent
expressions and we also want to sorry on value-dependent expressions.
This patch uses uses_template_parms, but guarded with p_t_d, because
u_t_p sets p_t_d and then v_d_e_p considers variables with reference
types value-dependent, which breaks builtin-has-attribute-6.c.
This is a regression and I also plan to apply this to gcc-10.
gcc/cp/ChangeLog:
PR c++/98355
* parser.c (cp_parser_has_attribute_expression): Use
uses_template_parms instead of type_dependent_expression_p.
gcc/testsuite/ChangeLog:
PR c++/98355
* g++.dg/ext/builtin-has-attribute2.C: New test.
(cherry picked from commit bab669f2fc643cb1673aecd177eec1c773e9e48e)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/98355] [9 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628
2020-12-17 16:51 [Bug c++/98355] New: [9/10/11 Regression] ICE in has_attribute, at c-family/c-attribs.c:5628 gscfq@t-online.de
` (9 preceding siblings ...)
2021-02-01 15:23 ` cvs-commit at gcc dot gnu.org
@ 2021-02-01 15:23 ` mpolacek at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-02-01 15:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98355
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
Summary|[9/10 Regression] ICE in |[9 Regression] ICE in
|has_attribute, at |has_attribute, at
|c-family/c-attribs.c:5628 |c-family/c-attribs.c:5628
--- Comment #9 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed in 10 too.
^ permalink raw reply [flat|nested] 12+ messages in thread