diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2020-11-27 23:02:45 +0000 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2020-12-01 11:25:03 +0000 |
commit | 31f76c9065b4579d263586b069cea2e79a2c4203 (patch) | |
tree | f7e784e42f4a1a2ea82d329dc1d07592290d4c84 /gcc | |
parent | 3940daff128a995693b405f47dc706b9622c861b (diff) | |
download | gcc-31f76c9065b4579d263586b069cea2e79a2c4203.zip gcc-31f76c9065b4579d263586b069cea2e79a2c4203.tar.gz gcc-31f76c9065b4579d263586b069cea2e79a2c4203.tar.bz2 |
C++ : Adjust warning for misplaced attributes.
This removes the reference to Objective-C++ for the warning that
attributes may not be placed before linkage specifications. It also
adds a note that they may be placed after that.
gcc/cp/ChangeLog:
* parser.c (cp_parser_declaration): Add a not about where
attributes may be placed.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/parser.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 63a2c96..939e73f 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -13567,9 +13567,12 @@ cp_parser_declaration (cp_parser* parser, tree prefix_attrs) /* We might have already been here. */ if (!c_dialect_objc ()) { + location_t where = get_finish (t2->location); warning_at (token1->location, OPT_Wattributes, "attributes are" - " only permitted in this position for Objective-C++," - " ignored"); + " not permitted in this position"); + where = linemap_position_for_loc_and_offset (line_table, + where, 1); + inform (where, "attributes may be inserted here"); attributes = NULL_TREE; } token1 = t1; |