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.

Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for
trunk?

gcc/cp/ChangeLog:

        PR c++/99893
        * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.

gcc/testsuite/ChangeLog:

        PR c++/99893
        * g++.dg/cpp0x/static_assert17.C: New test.
---
 gcc/cp/tree.c                                | 5 +++++
 gcc/testsuite/g++.dg/cpp0x/static_assert17.C | 9 +++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/cpp0x/static_assert17.C

diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 372d89fa9ed..fec5afaa2be 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -5446,6 +5446,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..64843c60edd
--- /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, ""); }...);
+}
-- 
2.32.0.rc0

Reply via email to