+2019-06-21 Marek Polacek <polacek@redhat.com>
+
+ PR c++/90953 - ICE with -Wmissing-format-attribute.
+ * c-common.c (check_function_arguments_recurse): Use
+ get_attribute_name.
+ (check_missing_format_attribute): Likewise.
+
2019-06-19 Marek Polacek <polacek@redhat.com>
PR c++/60364 - noreturn after first decl not diagnosed.
for (attrs = TYPE_ATTRIBUTES (type);
attrs;
attrs = TREE_CHAIN (attrs))
- if (is_attribute_p ("format_arg", TREE_PURPOSE (attrs)))
+ if (is_attribute_p ("format_arg", get_attribute_name (attrs)))
{
tree inner_arg;
tree format_num_expr;
tree ra;
for (ra = TYPE_ATTRIBUTES (ttr); ra; ra = TREE_CHAIN (ra))
- if (is_attribute_p ("format", TREE_PURPOSE (ra)))
+ if (is_attribute_p ("format", get_attribute_name (ra)))
break;
if (ra)
{
tree la;
for (la = TYPE_ATTRIBUTES (ttl); la; la = TREE_CHAIN (la))
- if (is_attribute_p ("format", TREE_PURPOSE (la)))
+ if (is_attribute_p ("format", get_attribute_name (la)))
break;
return !la;
}
+2019-06-21 Marek Polacek <polacek@redhat.com>
+
+ PR c++/90953 - ICE with -Wmissing-format-attribute.
+ * g++.dg/warn/miss-format-7.C: New test.
+
2019-06-21 Richard Biener <rguenther@suse.de>
PR debug/90914
--- /dev/null
+// PR c++/90953 - ICE with -Wmissing-format-attribute.
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wmissing-format-attribute" }
+
+namespace std {
+union [[gnu::may_alias]] _Any_data{};
+enum _Manager_operation { __get_type_info };
+template <typename> class A;
+class B {
+ typedef bool (*_Manager_type)(_Any_data, const _Any_data &,
+ _Manager_operation);
+public:
+ _Any_data _M_functor;
+ _Manager_type _M_manager;
+};
+
+struct type_info { } t;
+
+template <typename _Res, typename... _ArgTypes>
+class A<_Res(_ArgTypes...)> : B {
+ const type_info &target_type() const noexcept;
+};
+template <typename _Res, typename... _ArgTypes>
+const type_info &A<_Res(_ArgTypes...)>::target_type() const noexcept {
+ _Any_data __typeinfo_result;
+ _M_manager(__typeinfo_result, _M_functor, __get_type_info);
+ return t;
+}
+} // namespace std