summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/anon3.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/anon3.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/anon3.C25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/anon3.C b/gcc/testsuite/g++.old-deja/g++.jason/anon3.C
new file mode 100644
index 000000000..d2964f5aa
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/anon3.C
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+// Bug: g++ dies.
+
+class cl {
+public:
+ cl();
+ void set(void *, char *, int);
+private:
+ union {
+ float vf;
+ struct ff { // { dg-error "" } nested class in anonymous union
+ void *ptr;
+ char *name;
+ int sz;
+ } *vff;
+ };
+};
+
+void cl::set(void *p, char *n, int sz)
+{
+ vff = new ff; // This procude an internal compiler error.
+ vff->ptr = p;
+ vff->name = n;
+ vff->sz = sz;
+}