aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-02-15 19:39:27 -0500
committerJason Merrill <jason@gcc.gnu.org>2011-02-15 19:39:27 -0500
commit503c8e860b28659ab922f8500590d08353c0575c (patch)
treea6d0a3bb4ee91bd00b282995d12c2c735da5c1f8 /gcc/testsuite
parentaa2bf28660fa52a864fc8e0dacf4d5862c86e2e9 (diff)
downloadgcc-503c8e860b28659ab922f8500590d08353c0575c.zip
gcc-503c8e860b28659ab922f8500590d08353c0575c.tar.gz
gcc-503c8e860b28659ab922f8500590d08353c0575c.tar.bz2
re PR c++/46807 (internal compiler error: in synthesized_method_walk)
PR c++/46807 * method.c (synthesized_method_walk): Always exit early for trivial fn in C++98 mode. From-SVN: r170207
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/implicit-trivial1.C23
-rw-r--r--gcc/testsuite/g++.dg/inherit/implicit-trivial1.C23
3 files changed, 51 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d6834fb..2608ce5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-15 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/inherit/implicit-trivial1.C: New.
+ * g++.dg/cpp0x/implicit-trivial1.C: New.
+
2011-02-15 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/47725
diff --git a/gcc/testsuite/g++.dg/cpp0x/implicit-trivial1.C b/gcc/testsuite/g++.dg/cpp0x/implicit-trivial1.C
new file mode 100644
index 0000000..64084c1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/implicit-trivial1.C
@@ -0,0 +1,23 @@
+// PR c++/46807
+// { dg-options -std=c++0x }
+// In C++98/03, B::B(const B&) is trivial because A::A(const A&) is trivial,
+// even though doing overload resolution would mean calling the template
+// constructor. In C++0x, we do overload resolution to determine triviality.
+
+struct A
+{
+ A() {}
+private:
+ template <class T> A(T&); // { dg-error "private" }
+};
+
+struct B // { dg-error "implicitly deleted|this context" }
+{
+ mutable A a;
+};
+
+int main()
+{
+ B b;
+ B b2(b); // { dg-error "deleted" }
+}
diff --git a/gcc/testsuite/g++.dg/inherit/implicit-trivial1.C b/gcc/testsuite/g++.dg/inherit/implicit-trivial1.C
new file mode 100644
index 0000000..e63bd34
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/implicit-trivial1.C
@@ -0,0 +1,23 @@
+// PR c++/46807
+// { dg-options -std=c++98 }
+// In C++98/03, B::B(const B&) is trivial because A::A(const A&) is trivial,
+// even though doing overload resolution would mean calling the template
+// constructor. In C++0x, we do overload resolution to determine triviality.
+
+struct A
+{
+ A() {}
+private:
+ template <class T> A(T&);
+};
+
+struct B
+{
+ mutable A a;
+};
+
+int main()
+{
+ B b;
+ B b2(b);
+}