diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-02-28 12:34:51 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-02-28 12:34:51 +0000 |
commit | 9c467f1355d2f806a7ac06c22a18fd1d2e7e748f (patch) | |
tree | 345264f0e404c67990b05d749225e247268f4cb1 | |
parent | c0ff55b30de767e169675950e7dd20cae02fbacd (diff) | |
download | gcc-9c467f1355d2f806a7ac06c22a18fd1d2e7e748f.tar.gz |
PR target/33963
* tree.c (handle_dll_attribute): Disallow TYPE_DECLs for types
other than structures and unions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132744 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/tree.c | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4d168e35b2f..a0663ff0d3a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-02-28 Joseph Myers <joseph@codesourcery.com> + + PR target/33963 + * tree.c (handle_dll_attribute): Disallow TYPE_DECLs for types + other than structures and unions. + 2008-02-28 Richard Guenther <rguenther@suse.de> Revert: diff --git a/gcc/tree.c b/gcc/tree.c index 85b0b1c11c6..c39bccda098 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -3971,6 +3971,16 @@ handle_dll_attribute (tree * pnode, tree name, tree args, int flags, return NULL_TREE; } + if (TREE_CODE (node) == TYPE_DECL + && TREE_CODE (TREE_TYPE (node)) != RECORD_TYPE + && TREE_CODE (TREE_TYPE (node)) != UNION_TYPE) + { + *no_add_attrs = true; + warning (OPT_Wattributes, "%qs attribute ignored", + IDENTIFIER_POINTER (name)); + return NULL_TREE; + } + /* Report error on dllimport ambiguities seen now before they cause any damage. */ else if (is_attribute_p ("dllimport", name)) |