public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-9801] c++: parameter pack inside static_assert [PR99893]
@ 2022-04-08 14:00 Patrick Palka
0 siblings, 0 replies; only message in thread
From: Patrick Palka @ 2022-04-08 14:00 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:2837450c4e8f5f241db5519977ab24c1f871258f
commit r11-9801-g2837450c4e8f5f241db5519977ab24c1f871258f
Author: Patrick Palka <ppalka@redhat.com>
Date: Thu May 27 14:25:33 2021 -0400
c++: parameter pack inside static_assert [PR99893]
Here, we're not finding the parameter pack inside the static_assert because
STATIC_ASSERT trees are tcc_exceptional, and we weren't explicitly walking
them in cp_walk_subtrees.
PR c++/99893
PR c++/103885
gcc/cp/ChangeLog:
* tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/static_assert17.C: New test.
(cherry picked from commit fc3fdf0f2196e805a3a43ccb73595c33673670f3)
Diff:
---
gcc/cp/tree.c | 5 +++++
gcc/testsuite/g++.dg/cpp0x/static_assert17.C | 9 +++++++++
2 files changed, 14 insertions(+)
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index f67ede337c8..b499f38be15 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -5461,6 +5461,11 @@ cp_walk_subtrees (tree *tp, int *walk_subtrees_p, walk_tree_fn func,
}
break;
+ case STATIC_ASSERT:
+ WALK_SUBTREE (STATIC_ASSERT_CONDITION (*tp));
+ WALK_SUBTREE (STATIC_ASSERT_MESSAGE (*tp));
+ break;
+
default:
return NULL_TREE;
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/static_assert17.C b/gcc/testsuite/g++.dg/cpp0x/static_assert17.C
new file mode 100644
index 00000000000..28cbebe93af
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/static_assert17.C
@@ -0,0 +1,9 @@
+// PR c++/99893
+// { dg-do compile { target c++11 } }
+
+void f(...);
+
+template<class... Ts>
+void g() {
+ f([] { static_assert(Ts::value, ""); }...);
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-04-08 14:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 14:00 [gcc r11-9801] c++: parameter pack inside static_assert [PR99893] Patrick Palka
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).