summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/parse/parens2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/parse/parens2.C')
-rw-r--r--gcc/testsuite/g++.dg/parse/parens2.C11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/parse/parens2.C b/gcc/testsuite/g++.dg/parse/parens2.C
new file mode 100644
index 000000000..636dd8df3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/parens2.C
@@ -0,0 +1,11 @@
+/* PR c++/8842. */
+/* { dg-do compile } */
+int main( int argc, char* argv[] )
+{
+ int i = 5;
+ // This always worked:
+ // double l1 = double(int(i)) / double(int(i));
+ // But this used to give a parse error before the `/' token:
+ double l2 = (double(int(i)) / double(int(i)));
+}
+