aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/tree.cc')
-rw-r--r--gcc/cp/tree.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc
index 19dfb3e..4d5e3f5 100644
--- a/gcc/cp/tree.cc
+++ b/gcc/cp/tree.cc
@@ -5045,7 +5045,14 @@ handle_no_unique_addr_attribute (tree* node,
int /*flags*/,
bool* no_add_attrs)
{
- if (TREE_CODE (*node) != FIELD_DECL)
+ if (TREE_CODE (*node) == VAR_DECL)
+ {
+ DECL_MERGEABLE (*node) = true;
+ if (pedantic)
+ warning (OPT_Wattributes, "%qE attribute can only be applied to "
+ "non-static data members", name);
+ }
+ else if (TREE_CODE (*node) != FIELD_DECL)
{
warning (OPT_Wattributes, "%qE attribute can only be applied to "
"non-static data members", name);