]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: add fixed test [PR96364]
authorMarek Polacek <polacek@redhat.com>
Mon, 17 Feb 2025 17:12:55 +0000 (12:12 -0500)
committerMarek Polacek <polacek@redhat.com>
Mon, 17 Feb 2025 17:15:23 +0000 (12:15 -0500)
We were rejecting this, but the test compiles correctly since r14-6346.

PR c++/96364

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/gen-attrs-88.C: New test.

gcc/testsuite/g++.dg/cpp0x/gen-attrs-88.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-88.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-88.C
new file mode 100644 (file)
index 0000000..f90b7a4
--- /dev/null
@@ -0,0 +1,14 @@
+// PR c++/96364
+// { dg-do compile { target c++14 } }
+
+auto a[[]] [[]]();
+auto a() {}
+
+void v[[]] [[]]();
+void v() {}
+
+void g()
+{
+  v();
+  return a();
+}