From: Jason Merrill Date: Fri, 15 Jul 2016 18:56:29 +0000 (-0400) Subject: PR c++/71495 - spurious note during SFINAE. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=37a80bf956c991916d5d43e23640efdea91c5cb9;p=gcc.git PR c++/71495 - spurious note during SFINAE. * call.c (convert_like_real): Mask complain. * semantics.c (perform_koenig_lookup): Likewise. From-SVN: r238397 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0c381959310..2dfc8080be8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2016-07-15 Jason Merrill + PR c++/71495 + * call.c (convert_like_real): Mask complain. + * semantics.c (perform_koenig_lookup): Likewise. + PR c++/71092 * constexpr.c (cxx_eval_call_expression): Fail quietly when cgraph threw away DECL_SAVED_TREE. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 6ae5df76b1c..889852f362b 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -6640,7 +6640,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, expr = decay_conversion (expr, complain); if (expr == error_mark_node) { - if (complain) + if (complain & tf_error) { maybe_print_user_conv_context (convs); if (fn) diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 615d3aeab2a..19daeff4a44 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2245,7 +2245,7 @@ perform_koenig_lookup (cp_expr fn, vec *args, if (!fn) { /* The unqualified name could not be resolved. */ - if (complain) + if (complain & tf_error) fn = unqualified_fn_lookup_error (cp_expr (identifier, loc)); else fn = identifier; diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae57.C b/gcc/testsuite/g++.dg/cpp0x/sfinae57.C new file mode 100644 index 00000000000..975a330b9bd --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/sfinae57.C @@ -0,0 +1,16 @@ +// PR c++/71495 +// { dg-do compile { target c++11 } } + +struct A; +template void f(T); // { dg-bogus "initializing" } +template T&& declval(); +struct B +{ + template static decltype(f(declval())) g(int); + template void g(...); +} b; + +int main() +{ + b.g(42); +}