Commit 40595b8e by Jakub Jelinek Committed by Jakub Jelinek

re PR sanitizer/64984 (ICE in check_noexcept_t with ubsan)

	PR sanitizer/64984
	* except.c (check_noexcept_r): Return NULL for internal
	calls.

	* g++.dg/ubsan/pr64984.C: New test.

From-SVN: r220649
parent 72900b83
2015-02-12 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/64984
* except.c (check_noexcept_r): Return NULL for internal
calls.
2015-02-10 Jason Merrill <jason@redhat.com> 2015-02-10 Jason Merrill <jason@redhat.com>
PR c++/64994 PR c++/64994
......
...@@ -1148,7 +1148,7 @@ check_noexcept_r (tree *tp, int * /*walk_subtrees*/, void * /*data*/) ...@@ -1148,7 +1148,7 @@ check_noexcept_r (tree *tp, int * /*walk_subtrees*/, void * /*data*/)
{ {
tree t = *tp; tree t = *tp;
enum tree_code code = TREE_CODE (t); enum tree_code code = TREE_CODE (t);
if (code == CALL_EXPR if ((code == CALL_EXPR && CALL_EXPR_FN (t))
|| code == AGGR_INIT_EXPR) || code == AGGR_INIT_EXPR)
{ {
/* We can only use the exception specification of the called function /* We can only use the exception specification of the called function
......
2015-02-12 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/64984
* g++.dg/ubsan/pr64984.C: New test.
2015-02-12 James Greenhalgh <james.greenhalgh@arm.com> 2015-02-12 James Greenhalgh <james.greenhalgh@arm.com>
* gfortran.dg/pr45636.f90: XFAIL for aarch64* targets. * gfortran.dg/pr45636.f90: XFAIL for aarch64* targets.
......
// PR sanitizer/64984
// { dg-do compile }
// { dg-options "-fsanitize=vptr -std=gnu++11" }
template <typename X, X> struct K
{
static constexpr X v = 0;
typedef K t;
};
template <typename...> struct A;
template <typename X, typename Y>
struct A<X, Y> : Y
{
};
template <typename X> X M ();
template <typename...> struct B;
template <typename X, typename Y>
struct B<X, Y> : K<int, noexcept (static_cast<X>(M<Y>()))>
{
};
template <typename X, typename... Y>
struct G : A<int, B<X, Y...>>::t
{
};
template <typename X> struct J : G<X, X&&>
{
};
template <typename X> X&& foo (X&);
template <typename X> X&& bar (X&&);
template <typename X> struct P
{
P (X& x) : q (x) {}
X q;
};
template <typename...> struct Q;
template <typename X>
struct Q<X> : P<X>
{
typedef P<X> r;
X& s (Q&);
Q (X& x) : r (x) {}
Q (Q&& x) noexcept (J<X>::v) : r (foo<X>(s (x)))
{
}
};
template <typename... X> struct I : Q<X...>
{
I ();
I (X&... x) : Q<X...>(x...)
{
}
};
template <typename... X>
I<X&&...> baz (X&&... x)
{
return I <X&&...> (foo<X>(x)...);
}
template <typename X> struct F
{
int p;
void operator[] (X&& x)
{
baz (bar (x));
}
};
struct U
{
virtual ~U ();
};
int
main ()
{
F<U> m;
m[U ()];
}
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