This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Testcase for fixed PR c++/8237: Review wanted!


I intend to apply this.

But I wanted to check with the list first.  I think that this test case can 
probably be simplified to one which doesn't mess around with printf and
stdio.h.  I would like help doing that, if it's considered a good idea.

See PR c++/8237 for further information.

	* g++.dg/parse/parens1.C: New test.

Index: g++.dg/parse/parens1.C
===================================================================
RCS file: g++.dg/parse/parens1.C
diff -N g++.dg/parse/parens1.C
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ g++.dg/parse/parens1.C	1 Jan 2003 14:06:33 -0000
@@ -0,0 +1,20 @@
+/* PR c++/8237 */
+/* { dg-do compile } */
+#include <stdio.h>
+ 
+class A {
+public:
+  A() { printf("Acon\n"); }
+};
+ 
+class B {
+public:
+  B(A a) { printf("BAcon\n"); }
+  void form() { printf("Bform\n"); }
+};
+ 
+int main() {
+   // This used to give a parse error.
+   B(A()).form();
+}
+ 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]