diff options
author | Joseph Myers <joseph@codesourcery.com> | 2008-02-28 12:34:51 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2008-02-28 12:34:51 +0000 |
commit | dde75838e94cc9b22bc6210802b1849b2ae3f3cf (patch) | |
tree | 345264f0e404c67990b05d749225e247268f4cb1 /gcc/tree.c | |
parent | 3b3024215fae5daf1db2634fe070061837947458 (diff) | |
download | gcc-dde75838e94cc9b22bc6210802b1849b2ae3f3cf.zip gcc-dde75838e94cc9b22bc6210802b1849b2ae3f3cf.tar.gz gcc-dde75838e94cc9b22bc6210802b1849b2ae3f3cf.tar.bz2 |
re PR target/33963 (Dllimport attribute wrongly accepted on typedefs)
PR target/33963
* tree.c (handle_dll_attribute): Disallow TYPE_DECLs for types
other than structures and unions.
From-SVN: r132744
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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)) |