2008-03-27 Richard Guenther <rguenther@suse.de>
PR c/32511
* c-common.c (handle_weak_attribute): Reject combination of
weak and inline.
* gcc.dg/attr-weak-1.c: New testcase.
From-SVN: r133646
+2008-03-27 Richard Guenther <rguenther@suse.de>
+
+ PR c/32511
+ * c-common.c (handle_weak_attribute): Reject combination of
+ weak and inline.
+
2008-03-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/32810
bool * ARG_UNUSED (no_add_attrs))
{
if (TREE_CODE (*node) == FUNCTION_DECL
- || TREE_CODE (*node) == VAR_DECL)
+ && DECL_DECLARED_INLINE_P (*node))
+ {
+ error ("inline function %q+D cannot be declared weak", *node);
+ *no_add_attrs = true;
+ }
+ else if (TREE_CODE (*node) == FUNCTION_DECL
+ || TREE_CODE (*node) == VAR_DECL)
declare_weak (*node);
else
warning (OPT_Wattributes, "%qE attribute ignored", name);
-
return NULL_TREE;
}
+2008-03-27 Richard Guenther <rguenther@suse.de>
+
+ PR c/32511
+ * gcc.dg/attr-weak-1.c: New testcase.
+
2008-03-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/32810
--- /dev/null
+/* { dg-do compile } */
+
+__inline void foo(void) __attribute__((weak)); /* { dg-error "inline.*weak" } */
+