+2018-04-03 Jason Merrill <jason@redhat.com>
+
+ * typeck.c (merge_types): Limit matching attribute shortcut to
+ the default case.
+
2018-04-03 Jakub Jelinek <jakub@redhat.com>
PR c++/85147
return t1;
default:;
+ if (attribute_list_equal (TYPE_ATTRIBUTES (t1), attributes))
+ return t1;
+ else if (attribute_list_equal (TYPE_ATTRIBUTES (t2), attributes))
+ return t2;
+ break;
}
- if (attribute_list_equal (TYPE_ATTRIBUTES (t1), attributes))
- return t1;
- else if (attribute_list_equal (TYPE_ATTRIBUTES (t2), attributes))
- return t2;
- else
- return cp_build_type_attribute_variant (t1, attributes);
+ return cp_build_type_attribute_variant (t1, attributes);
}
/* Return the ARRAY_TYPE type without its domain. */
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+#include "noexcept-type19.h"
+
+extern "C" void *malloc (size_t);
+
+template<class T> void f(T*);
+
+void *g(size_t);
+
+int main()
+{
+ f<decltype(malloc)>(g);
+}