2014-01-30 Jason Merrill <jason@redhat.com>
+ PR c++/59633
+ * tree.c (walk_type_fields): Handle VECTOR_TYPE.
+
PR c++/59645
* cgraphunit.c (expand_thunk): Copy volatile arg to a temporary.
+2014-01-30 Jason Merrill <jason@redhat.com>
+
+ PR c++/59633
+ * decl2.c (attributes_naming_typedef_ok): New.
+ * cp-tree.h: Declare it.
+ * decl.c (grokdeclarator): Check it.
+ * tree.c (no_linkage_check): Handle VECTOR_TYPE.
+
2014-01-29 Jason Merrill <jason@redhat.com>
PR c++/59707
extern tree grokbitfield (const cp_declarator *, cp_decl_specifier_seq *,
tree, tree);
extern tree cp_reconstruct_complex_type (tree, tree);
+extern bool attributes_naming_typedef_ok (tree);
extern void cplus_decl_attributes (tree *, tree, int);
extern void finish_anon_union (tree);
extern void cp_write_global_declarations (void);
&& TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
&& TYPE_ANONYMOUS_P (type)
&& declspecs->type_definition_p
+ && attributes_naming_typedef_ok (*attrlist)
&& cp_type_quals (type) == TYPE_UNQUALIFIED)
{
tree t;
}
}
+/* Return true iff ATTRS are acceptable attributes to be applied in-place
+ to a typedef which gives a previously anonymous class or enum a name for
+ linkage purposes. */
+
+bool
+attributes_naming_typedef_ok (tree attrs)
+{
+ for (; attrs; attrs = TREE_CHAIN (attrs))
+ {
+ tree name = get_attribute_name (attrs);
+ if (is_attribute_p ("vector_size", name))
+ return false;
+ }
+ return true;
+}
+
/* Like reconstruct_complex_type, but handle also template trees. */
tree
case ARRAY_TYPE:
case POINTER_TYPE:
case REFERENCE_TYPE:
+ case VECTOR_TYPE:
return no_linkage_check (TREE_TYPE (t), relaxed_p);
case OFFSET_TYPE:
--- /dev/null
+// PR c++/59633
+// In C++98, the definition of bar is an error. In C++11, bar implicitly
+// gets internal linkage.
+
+typedef enum { e } T __attribute__((vector_size(8)));
+static void foo(T t) {}
+void bar (T t) {} // { dg-error "no linkage" "" { target c++98 } }
+// { dg-final { scan-assembler-not "globl\[ \t]*_Z3bar" } }
{
case POINTER_TYPE:
case REFERENCE_TYPE:
+ case VECTOR_TYPE:
/* We have to worry about mutually recursive pointers. These can't
be written in C. They can in Ada. It's pathological, but
there's an ACATS test (c38102a) that checks it. Deal with this