summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-17 22:35:29 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-17 22:35:29 +0000
commite59b9381e3f295094fe173f3e59babee4cb77a68 (patch)
tree69dd14ebdbf552a0333a15bf8a7c239e37f2ec70 /gcc/testsuite/g++.dg/init
parent1d8baa0efe4be51729c604adf7be9c36e786edff (diff)
downloadgcc-e59b9381e3f295094fe173f3e59babee4cb77a68.tar.gz
PR c++/29039
* typeck2.c (build_functional_cast): Don't zero-initialize non-PODs; instead, call their constructors. * method.c (synthesize_method): Always build mem-initializers, if we're synthesizing the default constructor. PR c++/29039 * g++.dg/init/ctor8.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117834 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/init')
-rw-r--r--gcc/testsuite/g++.dg/init/ctor8.C11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/init/ctor8.C b/gcc/testsuite/g++.dg/init/ctor8.C
new file mode 100644
index 00000000000..9723892f91c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/ctor8.C
@@ -0,0 +1,11 @@
+// PR c++/29039
+
+typedef struct S { // { dg-error "reference" }
+ int &r;
+};
+
+S f () {
+ return S (); // { dg-error "synthesized" }
+}
+
+