]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add testcase for PR c++/105229: ICE in lookup_template_class_1
authorSimon Martin <simartin@gcc.gnu.org>
Fri, 24 May 2024 08:56:36 +0000 (10:56 +0200)
committerSimon Martin <simartin@gcc.gnu.org>
Mon, 27 May 2024 09:20:48 +0000 (11:20 +0200)
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.

gcc/testsuite/g++.dg/parse/crash72.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/parse/crash72.C b/gcc/testsuite/g++.dg/parse/crash72.C
new file mode 100644 (file)
index 0000000..df469e2
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/105229
+// { dg-do compile { target c++20 } }
+// { dg-additional-options "-Wno-missing-template-keyword" }
+
+template <typename> void bar ()
+{
+  [] <int> {}.operator () <> (); // { dg-error "expected primary-expression" }
+}
+void foo ()
+{
+  bar<int> ();
+}