* decl2.c (mark_used): Defer synthesis of virtual functions.
* method.c (use_thunk): Make sure the target function has
DECL_INTERFACE_KNOWN.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181272
138bc75d-0d04-0410-961f-
82ee72b054a4
2011-11-10 Jason Merrill <jason@redhat.com>
+ PR c++/50973
+ * decl2.c (mark_used): Defer synthesis of virtual functions.
+ * method.c (use_thunk): Make sure the target function has
+ DECL_INTERFACE_KNOWN.
+
PR c++/51079, DR 495
* call.c (joust): Check the second conversion sequence
before checking templates.
&& !DECL_DEFAULTED_OUTSIDE_CLASS_P (decl)
&& ! DECL_INITIAL (decl))
{
+ /* Defer virtual destructors so that thunks get the right
+ linkage. */
+ if (DECL_VIRTUAL_P (decl) && !at_eof)
+ {
+ note_vague_linkage_fn (decl);
+ return true;
+ }
+
/* Remember the current location for a function we will end up
synthesizing. Then we can inform the user where it was
required in the case of error. */
on the stack (such as overload resolution candidates).
We could just let cp_write_global_declarations handle synthesizing
- this function, since we just added it to deferred_fns, but doing
+ this function by adding it to deferred_fns, but doing
it at the use site produces better error messages. */
++function_depth;
synthesize_method (decl);
DECL_EXTERNAL (thunk_fndecl) = 0;
/* The linkage of the function may have changed. FIXME in linkage
rewrite. */
+ gcc_assert (DECL_INTERFACE_KNOWN (function));
TREE_PUBLIC (thunk_fndecl) = TREE_PUBLIC (function);
DECL_VISIBILITY (thunk_fndecl) = DECL_VISIBILITY (function);
DECL_VISIBILITY_SPECIFIED (thunk_fndecl)
+2011-11-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/50973
+ * g++.dg/cpp0x/defaulted33.C: New.
+
2011-11-10 Andrew MacLeod <amacleod@redhat.com>
PR middle-end/51038
--- /dev/null
+// PR c++/50973
+// { dg-do compile { target c++11 } }
+
+class HD
+{
+ public:
+ virtual ~HD() {};
+};
+class InputHD : public virtual HD
+{
+};
+class OutputHD : public virtual HD
+{
+};
+class IOHD : public InputHD, public OutputHD
+{
+};
+template <typename T, unsigned int N>
+class ArrayNHD : public IOHD
+{
+ public:
+ ~ArrayNHD() = default;
+};
+class TLText
+{
+ ~TLText();
+ ArrayNHD<int, 1>* m_argsHD;
+};
+TLText::~TLText()
+{
+ delete m_argsHD;
+}