Commit 3f759575 by Jason Merrill Committed by Jason Merrill

Fix noexcept merging with system headers.

	* typeck.c (merge_types): Limit matching attribute shortcut to
	the default case.

From-SVN: r259042
parent b4231bf2
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
......
......@@ -899,14 +899,14 @@ merge_types (tree t1, tree t2)
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. */
......
// { 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);
}
#pragma GCC system_header
typedef decltype(sizeof(0)) size_t;
extern "C" void *malloc (size_t) throw();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment