* semantics.c (cxx_eval_call_expression): Unshare the result.
* g++.dg/cpp0x/constexpr-base3.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166967
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-11-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/46526
+ * semantics.c (cxx_eval_call_expression): Unshare the result.
+
2010-11-19 Nicola Pero <nicola.pero@meta-innovation.com>
* parser.c (cp_parser_objc_protocol_declaration): Pass attributes
}
pop_cx_call_context ();
- return result;
+ return unshare_expr (result);
}
/* FIXME speed this up, it's taking 16% of compile time on sieve testcase. */
2010-11-20 Jakub Jelinek <jakub@redhat.com>
+ PR c++/46526
+ * g++.dg/cpp0x/constexpr-base3.C: New test.
+
PR tree-optimization/45830
* gcc.target/i386/pr45830.c: New test.
* gcc.c-torture/execute/pr45830.c: New test.
--- /dev/null
+// PR c++/46526
+// { dg-do run }
+// { dg-options "-std=c++0x" }
+
+struct Base
+{
+ virtual int getid () = 0;
+};
+
+struct A : public Base
+{
+ virtual int getid () { return 1; }
+};
+
+struct B : public Base
+{
+ virtual int getid () { throw "here"; }
+};
+
+int
+main ()
+{
+ A a;
+ B b;
+ Base& ar = a;
+ ar.getid ();
+}