aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2020-02-05 17:59:28 -0500
committerJason Merrill <jason@redhat.com>2020-02-05 18:38:23 -0500
commitf6bef09771cf93e695cf719fb43db8c43e31acf5 (patch)
tree935e12f4206a452407e80aef63da78fef59f8aec /gcc/testsuite
parentba67231631b83b0b4dc499a42e07104233ee4b03 (diff)
downloadgcc-f6bef09771cf93e695cf719fb43db8c43e31acf5.zip
gcc-f6bef09771cf93e695cf719fb43db8c43e31acf5.tar.gz
gcc-f6bef09771cf93e695cf719fb43db8c43e31acf5.tar.bz2
c++: Fix decltype of empty pack expansion of parm.
In unevaluated context, we only substitute a single PARM_DECL, not the entire chain, but the handling of an empty pack expansion was missing that check. PR c++/93140 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in handling of TREE_CHAIN for empty pack.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic-parm1.C17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-parm1.C b/gcc/testsuite/g++.dg/cpp0x/variadic-parm1.C
new file mode 100644
index 0000000..4300c78
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic-parm1.C
@@ -0,0 +1,17 @@
+// PR c++/93140
+// { dg-do compile { target c++11 } }
+
+int
+bar ()
+{
+ return 42;
+}
+
+template <typename... R>
+void foo (R... r, decltype (bar (r...)) x = 0) {}
+
+int
+main ()
+{
+ foo (3);
+}