aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2018-05-24 13:36:21 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2018-05-24 13:36:21 +0000
commitea219e6e88a4c0b801b4c5eb971c6727bc31c7e6 (patch)
treebd4a0e1a00da4a3f5df1439cd5d91c04d25d4efb /gcc/testsuite/g++.dg
parent672dfc39f1dedd8b00fb10f6b7b01671b27c0f86 (diff)
downloadgcc-ea219e6e88a4c0b801b4c5eb971c6727bc31c7e6.zip
gcc-ea219e6e88a4c0b801b4c5eb971c6727bc31c7e6.tar.gz
gcc-ea219e6e88a4c0b801b4c5eb971c6727bc31c7e6.tar.bz2
re PR c++/85847 (unexpected expression of kind template_id_expr)
PR c++/85847 * init.c (build_new_1): Use fold_non_dependent_expr. Use a dedicated variable for its result. Fix a condition. (build_new): Use fold_non_dependent_expr. Tweak a condition. * g++.dg/cpp0x/new3.C: New test. From-SVN: r260671
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/new3.C11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/new3.C b/gcc/testsuite/g++.dg/cpp0x/new3.C
new file mode 100644
index 0000000..c388acf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/new3.C
@@ -0,0 +1,11 @@
+// PR c++/85847
+// { dg-do compile { target c++11 } }
+
+template <class>
+int f(int b) { return b; }
+
+template <class>
+void g()
+{
+ auto a = new int[f<int>(2), 2];
+}