Commit 37a80bf9 by Jason Merrill Committed by Jason Merrill

PR c++/71495 - spurious note during SFINAE.

	* call.c (convert_like_real): Mask complain.
	* semantics.c (perform_koenig_lookup): Likewise.

From-SVN: r238397
parent 479d0ed5
2016-07-15 Jason Merrill <jason@redhat.com> 2016-07-15 Jason Merrill <jason@redhat.com>
PR c++/71495
* call.c (convert_like_real): Mask complain.
* semantics.c (perform_koenig_lookup): Likewise.
PR c++/71092 PR c++/71092
* constexpr.c (cxx_eval_call_expression): Fail quietly when cgraph * constexpr.c (cxx_eval_call_expression): Fail quietly when cgraph
threw away DECL_SAVED_TREE. threw away DECL_SAVED_TREE.
......
...@@ -6640,7 +6640,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, ...@@ -6640,7 +6640,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
expr = decay_conversion (expr, complain); expr = decay_conversion (expr, complain);
if (expr == error_mark_node) if (expr == error_mark_node)
{ {
if (complain) if (complain & tf_error)
{ {
maybe_print_user_conv_context (convs); maybe_print_user_conv_context (convs);
if (fn) if (fn)
......
...@@ -2245,7 +2245,7 @@ perform_koenig_lookup (cp_expr fn, vec<tree, va_gc> *args, ...@@ -2245,7 +2245,7 @@ perform_koenig_lookup (cp_expr fn, vec<tree, va_gc> *args,
if (!fn) if (!fn)
{ {
/* The unqualified name could not be resolved. */ /* The unqualified name could not be resolved. */
if (complain) if (complain & tf_error)
fn = unqualified_fn_lookup_error (cp_expr (identifier, loc)); fn = unqualified_fn_lookup_error (cp_expr (identifier, loc));
else else
fn = identifier; fn = identifier;
......
// PR c++/71495
// { dg-do compile { target c++11 } }
struct A;
template <class T> void f(T); // { dg-bogus "initializing" }
template <class T> T&& declval();
struct B
{
template <class T, class U> static decltype(f<T>(declval<U>())) g(int);
template <class T, class U> void g(...);
} b;
int main()
{
b.g<A,A>(42);
}
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