diff mbox

[obvious] Guard inform with warning return value

Message ID 5596D5FC.8050901@oracle.com
State New
Headers show

Commit Message

Paolo Carlini July 3, 2015, 6:35 p.m. UTC
Hi,

noticed this nit in a conditional for c++11 attributes. I'm going to 
commit the below as obvious.

Thanks,
Paolo.

/////////////////////
2015-07-03  Paolo Carlini  <paolo.carlini@oracle.com>

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

Patch

Index: attribs.c
===================================================================
--- attribs.c	(revision 225384)
+++ attribs.c	(working copy)
@@ -469,10 +469,10 @@  decl_attributes (tree *node, tree attributes, int
 	  /* 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;
 	}