2003-12-28 Mark Mitchell <mark@codesourcery.com>
+ PR c++/13081
+ * decl.c (duplicate_decls): Preserve inline-ness when redeclaring
+ a function template.
+
+ PR c++/12613
+ * decl.c (reshape_init): Reject GNU colon-style designated
+ initializers in arrays.
+
PR c++/13009
* call.c (build_special_member_call): Do not assume that we have a
pointer to the complete object in an assignment operator.
= DECL_SOURCE_LOCATION (newdecl);
}
+ if (DECL_FUNCTION_TEMPLATE_P (newdecl))
+ {
+ DECL_INLINE (DECL_TEMPLATE_RESULT (olddecl))
+ |= DECL_INLINE (DECL_TEMPLATE_RESULT (newdecl));
+ DECL_DECLARED_INLINE_P (DECL_TEMPLATE_RESULT (olddecl))
+ |= DECL_DECLARED_INLINE_P (DECL_TEMPLATE_RESULT (newdecl));
+ }
+
return olddecl;
}
TREE_CHAIN (element_init) = CONSTRUCTOR_ELTS (new_init);
CONSTRUCTOR_ELTS (new_init) = element_init;
if (TREE_PURPOSE (element_init))
- index = TREE_PURPOSE (element_init);
+ {
+ tree next_index = TREE_PURPOSE (element_init);
+ if (TREE_CODE (next_index) == IDENTIFIER_NODE)
+ {
+ error ("name `%D' used in a GNU-style designated "
+ "initializer for an array", next_index);
+ TREE_PURPOSE (element_init) = NULL_TREE;
+ }
+ else
+ index = next_index;
+ }
}
}
else
2003-12-28 Mark Mitchell <mark@codesourcery.com>
+ PR c++/13081
+ * g++.dg/opt/inline6.C: New test.
+
+ PR c++/12613
+ * g++.dg/parse/error9.C: New test.
+
* gcc.dg/const-elim-1.c: XFAIL on arm-*-*.
2003-12-28 Mark Mitchell <mark@codesourcery.com>
--- /dev/null
+// PR c++/13081
+// { dg-options "-O2" }
+// { dg-final { scan-assembler-not "foo" } }
+
+template<typename T> T foo(T);
+
+template<typename T> inline T foo(T t)
+{
+ return t;
+}
+
+void bar (long& l) {
+ l = foo(l);
+}