]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/c-family/c-format.cc
c-family: Fix ICE with -Wsuggest-attribute [PR98487]
[thirdparty/gcc.git] / gcc / c-family / c-format.cc
index 01adea4ff413019c5b6e6a07ab62a8f5d877587f..08643c5da7aa77d276f5c640cda9a60a88793ce0 100644 (file)
@@ -1215,7 +1215,7 @@ check_function_format (const_tree fn, tree attrs, int nargs,
              for (c = TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl));
                   c;
                   c = TREE_CHAIN (c))
-               if (is_attribute_p ("format", TREE_PURPOSE (c))
+               if (is_attribute_p ("format", get_attribute_name (c))
                    && (decode_format_type (IDENTIFIER_POINTER
                                            (TREE_VALUE (TREE_VALUE (c))))
                        == info.format_type))