Commit d3061adb by Jason Merrill Committed by Jason Merrill

class.c (finish_struct_1): Check virtual functions for missing ABI tags.

	* class.c (finish_struct_1): Check virtual functions
	for missing ABI tags.

From-SVN: r193525
parent 4fce678f
2012-11-13 Jason Merrill <jason@redhat.com> 2012-11-13 Jason Merrill <jason@redhat.com>
* class.c (finish_struct_1): Check virtual functions
for missing ABI tags.
PR c++/55275 PR c++/55275
* pt.c (maybe_process_partial_specialization): Update * pt.c (maybe_process_partial_specialization): Update
DECL_SOURCE_LOCATION for new specializations. DECL_SOURCE_LOCATION for new specializations.
......
...@@ -6275,6 +6275,12 @@ finish_struct_1 (tree t) ...@@ -6275,6 +6275,12 @@ finish_struct_1 (tree t)
/* Here we know enough to change the type of our virtual /* Here we know enough to change the type of our virtual
function table, but we will wait until later this function. */ function table, but we will wait until later this function. */
build_primary_vtable (CLASSTYPE_PRIMARY_BINFO (t), t); build_primary_vtable (CLASSTYPE_PRIMARY_BINFO (t), t);
/* If we're warning about ABI tags, check the types of the new
virtual functions. */
if (warn_abi_tag)
for (tree v = virtuals; v; v = TREE_CHAIN (v))
check_abi_tags (t, TREE_VALUE (v));
} }
if (TYPE_CONTAINS_VPTR_P (t)) if (TYPE_CONTAINS_VPTR_P (t))
......
...@@ -15622,7 +15622,7 @@ A redeclaration of a function or class must not add new ABI tags, ...@@ -15622,7 +15622,7 @@ A redeclaration of a function or class must not add new ABI tags,
since doing so would change the mangled name. since doing so would change the mangled name.
The @option{-Wabi-tag} flag enables a warning about a class which does The @option{-Wabi-tag} flag enables a warning about a class which does
not have all the ABI tags used by its subobjects; for users with code not have all the ABI tags used by its subobjects and virtual functions; for users with code
that needs to coexist with an earlier ABI, using this option can help that needs to coexist with an earlier ABI, using this option can help
to find all affected types that need to be tagged. to find all affected types that need to be tagged.
......
// { dg-options "-Wabi-tag" }
struct __attribute ((abi_tag ("X"))) A { };
struct B // { dg-warning "abi tag" }
{
virtual void f(A); // { dg-message "declared here" }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment