attribs.c (decl_attributes): Guard inform with the return value of the preceding...
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 3 Jul 2015 18:56:40 +0000 (18:56 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 3 Jul 2015 18:56:40 +0000 (18:56 +0000)
2015-07-03  Paolo Carlini  <paolo.carlini@oracle.com>

* attribs.c (decl_attributes): Guard inform with the return value
of the preceding warning.

From-SVN: r225402

gcc/ChangeLog
gcc/attribs.c

index 3be66ccb5abf7da6309cda73c5b1e188ce82b0d8..50f0a54d8fded5da04105e41ae47039bbddf6230 100644 (file)
@@ -1,3 +1,8 @@
+2015-07-03  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * attribs.c (decl_attributes): Guard inform with the return value
+       of the preceding warning.
+
 2015-07-03  James Greenhalgh  <james.greenhalgh@arm.com>
 
        * doc/invoke.texi (moverride): Move to correct section.
index 265009b47a2e945bd3178533212b235eabd48429..784079b68143e0dfdc628d5bcee87797ed098e80 100644 (file)
@@ -469,10 +469,10 @@ decl_attributes (tree *node, tree attributes, int flags)
          /* This is a c++11 attribute that appertains to a
             type-specifier, outside of the definition of, a class
             type.  Ignore it.  */
-         warning (OPT_Wattributes, "attribute ignored");
-         inform (input_location,
-                 "an attribute that appertains to a type-specifier "
-                 "is ignored");
+         if (warning (OPT_Wattributes, "attribute ignored"))
+           inform (input_location,
+                   "an attribute that appertains to a type-specifier "
+                   "is ignored");
          continue;
        }