public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106024] New: ICE on missing template keyword in template method call in pack expansion
@ 2022-06-18 22:44 kacper.slominski72 at gmail dot com
2022-06-20 8:13 ` [Bug c++/106024] " marxin at gcc dot gnu.org
` (12 more replies)
0 siblings, 13 replies; 14+ messages in thread
From: kacper.slominski72 at gmail dot com @ 2022-06-18 22:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106024
Bug ID: 106024
Summary: ICE on missing template keyword in template method
call in pack expansion
Product: gcc
Version: 12.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: kacper.slominski72 at gmail dot com
Target Milestone: ---
Created attachment 53162
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53162&action=edit
-freport-bug output
The following code, when compiled with -std=c++20, causes an ICE. Attached is
the file produced by -freport-bug.
auto foo() {
return [&] <auto...args> () {
return [] (auto...) {} (
[] <auto T> (auto...) {
return 1;
}.operator()<args>(args...)...
);
}.operator()<1, 2, 3>();
}
I'm tempted to say this is ICE-on-invalid since adding the missing "template"
keyword before "operator()" gets rid of it, but I'm not 100% sure.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/106024] ICE on missing template keyword in template method call in pack expansion
2022-06-18 22:44 [Bug c++/106024] New: ICE on missing template keyword in template method call in pack expansion kacper.slominski72 at gmail dot com
@ 2022-06-20 8:13 ` marxin at gcc dot gnu.org
2022-06-20 23:32 ` [Bug c++/106024] [11/12/13 Regression] " pinskia at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-06-20 8:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106024
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |marxin at gcc dot gnu.org
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Note clang rejects it with:
clang++ pr106033.C -c -std=c++2a
pr106033.C:6:27: error: expected ')'
}.operator()<args>(args...)...
^
pr106033.C:6:22: note: to match this '('
}.operator()<args>(args...)...
^
pr106033.C:6:6: error: missing 'template' keyword prior to dependent template
name 'operator()'
}.operator()<args>(args...)...
^
pr106033.C:8:4: note: in instantiation of function template specialization
'foo()::(anonymous class)::operator()<1, 2, 3>' requested here
}.operator()<1, 2, 3>();
^
2 errors generated.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/106024] [11/12/13 Regression] ICE on missing template keyword in template method call in pack expansion
2022-06-18 22:44 [Bug c++/106024] New: ICE on missing template keyword in template method call in pack expansion kacper.slominski72 at gmail dot com
2022-06-20 8:13 ` [Bug c++/106024] " marxin at gcc dot gnu.org
@ 2022-06-20 23:32 ` pinskia at gcc dot gnu.org
2022-06-20 23:34 ` pinskia at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-06-20 23:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106024
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|ICE on missing template |[11/12/13 Regression] ICE
|keyword in template method |on missing template keyword
|call in pack expansion |in template method call in
| |pack expansion
Target Milestone|--- |11.4
Known to work| |10.3.0
Known to fail| |11.1.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/106024] [11/12/13 Regression] ICE on missing template keyword in template method call in pack expansion
2022-06-18 22:44 [Bug c++/106024] New: ICE on missing template keyword in template method call in pack expansion kacper.slominski72 at gmail dot com
2022-06-20 8:13 ` [Bug c++/106024] " marxin at gcc dot gnu.org
2022-06-20 23:32 ` [Bug c++/106024] [11/12/13 Regression] " pinskia at gcc dot gnu.org
@ 2022-06-20 23:34 ` pinskia at gcc dot gnu.org
2022-06-24 2:19 ` jason at gcc dot gnu.org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-06-20 23:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106024
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |10.3.0
Status|UNCONFIRMED |NEW
Summary|ICE on missing template |[11/12/13 Regression] ICE
|keyword in template method |on missing template keyword
|call in pack expansion |in template method call in
| |pack expansion
Last reconfirmed| |2022-06-20
Ever confirmed|0 |1
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, a regression from 10.x.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/106024] [11/12/13 Regression] ICE on missing template keyword in template method call in pack expansion
2022-06-18 22:44 [Bug c++/106024] New: ICE on missing template keyword in template method call in pack expansion kacper.slominski72 at gmail dot com
` (2 preceding siblings ...)
2022-06-20 23:34 ` pinskia at gcc dot gnu.org
@ 2022-06-24 2:19 ` jason at gcc dot gnu.org
2022-07-01 14:51 ` cvs-commit at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2022-06-24 2:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106024
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Testcase with only one lambda:
template <class... Ts> void sink(Ts &&...);
template <auto... args> void f()
{
sink ([] <auto T> (auto...) { return 1; }
.operator()<args>(args...)...);
}
int main()
{
f<1,2,3>();
}
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/106024] [11/12/13 Regression] ICE on missing template keyword in template method call in pack expansion
2022-06-18 22:44 [Bug c++/106024] New: ICE on missing template keyword in template method call in pack expansion kacper.slominski72 at gmail dot com
` (3 preceding siblings ...)
2022-06-24 2:19 ` jason at gcc dot gnu.org
@ 2022-07-01 14:51 ` cvs-commit at gcc dot gnu.org
2022-07-01 14:51 ` cvs-commit at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-01 14:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106024
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:
https://gcc.gnu.org/g:07ac550393d00fcadcee21b44abee6bb30c93949
commit r13-1390-g07ac550393d00fcadcee21b44abee6bb30c93949
Author: Jason Merrill <jason@redhat.com>
Date: Thu Jun 23 23:14:35 2022 -0400
c++: dependent generic lambda template-id [PR106024]
We were wrongly looking up the generic lambda op() in a dependent scope,
and
then trying to look up its instantiation at substitution time, but lambdas
aren't instantiated, so we crashed. The fix is to not look into dependent
class scopes.
But this created trouble with wrongly trying to use a template from the
enclosing scope when we aren't actually looking at a
template-argument-list,
in template/lookup18.C, so let's avoid that.
PR c++/106024
gcc/cp/ChangeLog:
* parser.cc (missing_template_diag): Factor out...
(cp_parser_id_expression): ...from here.
(cp_parser_lookup_name): Don't look in dependent object_type.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/lambda-generic10.C: New test.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/106024] [11/12/13 Regression] ICE on missing template keyword in template method call in pack expansion
2022-06-18 22:44 [Bug c++/106024] New: ICE on missing template keyword in template method call in pack expansion kacper.slominski72 at gmail dot com
` (4 preceding siblings ...)
2022-07-01 14:51 ` cvs-commit at gcc dot gnu.org
@ 2022-07-01 14:51 ` cvs-commit at gcc dot gnu.org
2022-07-01 15:42 ` cvs-commit at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-01 14:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106024
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:
https://gcc.gnu.org/g:c17206709f94331e81443e2bdcf135a6ab7428ce
commit r12-8533-gc17206709f94331e81443e2bdcf135a6ab7428ce
Author: Jason Merrill <jason@redhat.com>
Date: Thu Jun 23 23:14:35 2022 -0400
c++: dependent generic lambda template-id [PR106024]
We were wrongly looking up the generic lambda op() in a dependent scope,
and
then trying to look up its instantiation at substitution time, but lambdas
aren't instantiated, so we crashed. The fix is to not look into dependent
class scopes.
But this created trouble with wrongly trying to use a template from the
enclosing scope when we aren't actually looking at a
template-argument-list,
in template/lookup18.C, so let's avoid that.
PR c++/106024
gcc/cp/ChangeLog:
* parser.cc (missing_template_diag): Factor out...
(cp_parser_id_expression): ...from here.
(cp_parser_lookup_name): Don't look in dependent object_type.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/lambda-generic10.C: New test.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/106024] [11/12/13 Regression] ICE on missing template keyword in template method call in pack expansion
2022-06-18 22:44 [Bug c++/106024] New: ICE on missing template keyword in template method call in pack expansion kacper.slominski72 at gmail dot com
` (5 preceding siblings ...)
2022-07-01 14:51 ` cvs-commit at gcc dot gnu.org
@ 2022-07-01 15:42 ` cvs-commit at gcc dot gnu.org
2022-07-01 16:32 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-01 15:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106024
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:
https://gcc.gnu.org/g:e748398b3ef6412ef35b85ef6b0893809aeb49cd
commit r12-8537-ge748398b3ef6412ef35b85ef6b0893809aeb49cd
Author: Jason Merrill <jason@redhat.com>
Date: Fri Jul 1 11:02:54 2022 -0400
c++: simpler fix for PR106024
Actually, for release branches let's just avoid the lookup for the lambdas
that are the problematic case and only make the bigger change on trunk.
PR c++/106024
gcc/cp/ChangeLog:
* parser.cc (cp_parser_lookup_name): Limit previous change to
lambdas.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/106024] [11/12/13 Regression] ICE on missing template keyword in template method call in pack expansion
2022-06-18 22:44 [Bug c++/106024] New: ICE on missing template keyword in template method call in pack expansion kacper.slominski72 at gmail dot com
` (6 preceding siblings ...)
2022-07-01 15:42 ` cvs-commit at gcc dot gnu.org
@ 2022-07-01 16:32 ` cvs-commit at gcc dot gnu.org
2022-07-01 16:32 ` jason at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-01 16:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106024
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:
https://gcc.gnu.org/g:252e9dfee9b1d01e0e44773ad83e0e44f3650945
commit r11-10100-g252e9dfee9b1d01e0e44773ad83e0e44f3650945
Author: Jason Merrill <jason@redhat.com>
Date: Thu Jun 23 23:14:35 2022 -0400
c++: dependent generic lambda template-id [PR106024]
We were wrongly looking up the generic lambda op() in a dependent scope,
and
then trying to look up its instantiation at substitution time, but lambdas
aren't instantiated, so we crashed. The fix is to not look into dependent
lambda scopes.
PR c++/106024
gcc/cp/ChangeLog:
* parser.c (cp_parser_lookup_name): Don't look in dependent lambda.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/lambda-generic10.C: New test.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/106024] [11/12/13 Regression] ICE on missing template keyword in template method call in pack expansion
2022-06-18 22:44 [Bug c++/106024] New: ICE on missing template keyword in template method call in pack expansion kacper.slominski72 at gmail dot com
` (7 preceding siblings ...)
2022-07-01 16:32 ` cvs-commit at gcc dot gnu.org
@ 2022-07-01 16:32 ` jason at gcc dot gnu.org
2022-07-06 4:40 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2022-07-01 16:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106024
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 11.4/12.2/13.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/106024] [11/12/13 Regression] ICE on missing template keyword in template method call in pack expansion
2022-06-18 22:44 [Bug c++/106024] New: ICE on missing template keyword in template method call in pack expansion kacper.slominski72 at gmail dot com
` (8 preceding siblings ...)
2022-07-01 16:32 ` jason at gcc dot gnu.org
@ 2022-07-06 4:40 ` cvs-commit at gcc dot gnu.org
2022-08-09 7:09 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-06 4:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106024
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:
https://gcc.gnu.org/g:656c0212909bc91b1025aa12774d981adb531b4c
commit r13-1516-g656c0212909bc91b1025aa12774d981adb531b4c
Author: Jason Merrill <jason@redhat.com>
Date: Tue Jul 5 17:05:47 2022 -0400
c++: dependent conversion operator lookup [PR106179]
This testcase demonstrates that my assumption that we would only be
interested in a class template lookup if the template-id is followed by ::
was wrong.
PR c++/106179
PR c++/106024
gcc/cp/ChangeLog:
* parser.cc (cp_parser_lookup_name): Remove :: requirement
for using unqualified lookup result.
gcc/testsuite/ChangeLog:
* g++.dg/template/operator16.C: New test.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/106024] [11/12/13 Regression] ICE on missing template keyword in template method call in pack expansion
2022-06-18 22:44 [Bug c++/106024] New: ICE on missing template keyword in template method call in pack expansion kacper.slominski72 at gmail dot com
` (9 preceding siblings ...)
2022-07-06 4:40 ` cvs-commit at gcc dot gnu.org
@ 2022-08-09 7:09 ` pinskia at gcc dot gnu.org
2024-04-15 22:30 ` pinskia at gcc dot gnu.org
2024-05-27 9:21 ` cvs-commit at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-08-09 7:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106024
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amir.ahmed.ansari at outlook dot c
| |om
--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 106351 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/106024] [11/12/13 Regression] ICE on missing template keyword in template method call in pack expansion
2022-06-18 22:44 [Bug c++/106024] New: ICE on missing template keyword in template method call in pack expansion kacper.slominski72 at gmail dot com
` (10 preceding siblings ...)
2022-08-09 7:09 ` pinskia at gcc dot gnu.org
@ 2024-04-15 22:30 ` pinskia at gcc dot gnu.org
2024-05-27 9:21 ` cvs-commit at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-15 22:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106024
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |johelegp at gmail dot com
--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 102931 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/106024] [11/12/13 Regression] ICE on missing template keyword in template method call in pack expansion
2022-06-18 22:44 [Bug c++/106024] New: ICE on missing template keyword in template method call in pack expansion kacper.slominski72 at gmail dot com
` (11 preceding siblings ...)
2024-04-15 22:30 ` pinskia at gcc dot gnu.org
@ 2024-05-27 9:21 ` cvs-commit at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-27 9:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106024
--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Simon Martin <simartin@gcc.gnu.org>:
https://gcc.gnu.org/g:88c9b96b2800ddb7a499bd10abaa9441a471d5fe
commit r15-847-g88c9b96b2800ddb7a499bd10abaa9441a471d5fe
Author: Simon Martin <simartin@gcc.gnu.org>
Date: Fri May 24 10:56:36 2024 +0200
Add testcase for PR c++/105229: ICE in lookup_template_class_1
The test case in PR c++/105229 has been fixed since 11.4 (via
PR c++/106024) - the attached patch simply adds the case to
the test suite.
Successfully tested on x86_64-pc-linux-gnu.
PR c++/105229
gcc/testsuite/ChangeLog:
* g++.dg/parse/crash72.C: New test.
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2024-05-27 9:21 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-18 22:44 [Bug c++/106024] New: ICE on missing template keyword in template method call in pack expansion kacper.slominski72 at gmail dot com
2022-06-20 8:13 ` [Bug c++/106024] " marxin at gcc dot gnu.org
2022-06-20 23:32 ` [Bug c++/106024] [11/12/13 Regression] " pinskia at gcc dot gnu.org
2022-06-20 23:34 ` pinskia at gcc dot gnu.org
2022-06-24 2:19 ` jason at gcc dot gnu.org
2022-07-01 14:51 ` cvs-commit at gcc dot gnu.org
2022-07-01 14:51 ` cvs-commit at gcc dot gnu.org
2022-07-01 15:42 ` cvs-commit at gcc dot gnu.org
2022-07-01 16:32 ` cvs-commit at gcc dot gnu.org
2022-07-01 16:32 ` jason at gcc dot gnu.org
2022-07-06 4:40 ` cvs-commit at gcc dot gnu.org
2022-08-09 7:09 ` pinskia at gcc dot gnu.org
2024-04-15 22:30 ` pinskia at gcc dot gnu.org
2024-05-27 9:21 ` cvs-commit 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).