This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Testcase for fixed PR c++/8842
- From: Nathanael Nerode <neroden at twcny dot rr dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 1 Jan 2003 11:31:51 -0500
- Subject: Testcase for fixed PR c++/8842
Applied.
g++.dg/parse/parens2.C: New test.
Index: g++.dg/parse/parens2.C
===================================================================
RCS file: g++.dg/parse/parens2.C
diff -N g++.dg/parse/parens2.C
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ g++.dg/parse/parens2.C 1 Jan 2003 16:31:36 -0000
@@ -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)));
+}
+