2011-06-23 Jason Merrill <jason@redhat.com>
+ PR c++/49440
+ * class.c (set_linkage_according_to_type): Just check TREE_PUBLIC
+ on the type's name.
+
PR c++/49395
* init.c (build_zero_init_1): Strip cv-quals from scalar types.
the abstract. */
void
-set_linkage_according_to_type (tree type, tree decl)
+set_linkage_according_to_type (tree type ATTRIBUTE_UNUSED, tree decl)
{
- /* If TYPE involves a local class in a function with internal
- linkage, then DECL should have internal linkage too. Other local
- classes have no linkage -- but if their containing functions
- have external linkage, it makes sense for DECL to have external
- linkage too. That will allow template definitions to be merged,
- for example. */
- if (no_linkage_check (type, /*relaxed_p=*/true))
- {
- TREE_PUBLIC (decl) = 0;
- DECL_INTERFACE_KNOWN (decl) = 1;
- }
- else
- TREE_PUBLIC (decl) = 1;
+ TREE_PUBLIC (decl) = 1;
+ determine_visibility (decl);
}
/* Create a VAR_DECL for a primary or secondary vtable for CLASS_TYPE.
--- /dev/null
+// PR c++/49440
+// The typeinfo name for A should start with * so we compare
+// it by address rather than contents.
+
+// { dg-final { scan-assembler "\"\*N\[^\"\]+1AE\"" } }
+
+namespace
+{
+ class A { };
+}
+
+void f()
+{
+ throw A();
+}