mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-22 21:31:19 +08:00
re PR c/32511 (GCC rejects inline+weak function)
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
This commit is contained in:
parent
62bc00e258
commit
6b4e94bcae
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -5518,11 +5518,16 @@ handle_weak_attribute (tree *node, tree name,
|
||||
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;
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
4
gcc/testsuite/gcc.dg/attr-weak-1.c
Normal file
4
gcc/testsuite/gcc.dg/attr-weak-1.c
Normal file
@ -0,0 +1,4 @@
|
||||
/* { dg-do compile } */
|
||||
|
||||
__inline void foo(void) __attribute__((weak)); /* { dg-error "inline.*weak" } */
|
||||
|
Loading…
x
Reference in New Issue
Block a user