re PR c++/50961 (Fails to decay template function properly(?))
/cp 2014-07-17 Paolo Carlini <paolo.carlini@oracle.com> PR c++/50961 * call.c (standard_conversion): Use resolve_nondeduced_context for type_unknown_p (EXPR) && TREE_CODE (TO) == BOOLEAN_TYPE. /testsuite 2014-07-17 Paolo Carlini <paolo.carlini@oracle.com> PR c++/50961 * g++.dg/template/operator13.C: New. From-SVN: r212760
This commit is contained in:
parent
37738b0fe4
commit
835dee55a1
@ -1,3 +1,9 @@
|
||||
2014-07-17 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/50961
|
||||
* call.c (standard_conversion): Use resolve_nondeduced_context
|
||||
for type_unknown_p (EXPR) && TREE_CODE (TO) == BOOLEAN_TYPE.
|
||||
|
||||
2014-07-17 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/61804
|
||||
|
@ -1107,14 +1107,22 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
|
||||
to = strip_top_quals (to);
|
||||
from = strip_top_quals (from);
|
||||
|
||||
if ((TYPE_PTRFN_P (to) || TYPE_PTRMEMFUNC_P (to))
|
||||
&& expr && type_unknown_p (expr))
|
||||
if (expr && type_unknown_p (expr))
|
||||
{
|
||||
tsubst_flags_t tflags = tf_conv;
|
||||
expr = instantiate_type (to, expr, tflags);
|
||||
if (expr == error_mark_node)
|
||||
return NULL;
|
||||
from = TREE_TYPE (expr);
|
||||
if (TYPE_PTRFN_P (to) || TYPE_PTRMEMFUNC_P (to))
|
||||
{
|
||||
tsubst_flags_t tflags = tf_conv;
|
||||
expr = instantiate_type (to, expr, tflags);
|
||||
if (expr == error_mark_node)
|
||||
return NULL;
|
||||
from = TREE_TYPE (expr);
|
||||
}
|
||||
else if (TREE_CODE (to) == BOOLEAN_TYPE)
|
||||
{
|
||||
/* Necessary for eg, TEMPLATE_ID_EXPRs (c++/50961). */
|
||||
expr = resolve_nondeduced_context (expr);
|
||||
from = TREE_TYPE (expr);
|
||||
}
|
||||
}
|
||||
|
||||
fcode = TREE_CODE (from);
|
||||
|
@ -1,3 +1,8 @@
|
||||
2014-07-17 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/50961
|
||||
* g++.dg/template/operator13.C: New.
|
||||
|
||||
2014-07-17 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
||||
|
||||
* gcc.target/aarch64/simd/vfma_f64.c: New test.
|
||||
|
12
gcc/testsuite/g++.dg/template/operator13.C
Normal file
12
gcc/testsuite/g++.dg/template/operator13.C
Normal file
@ -0,0 +1,12 @@
|
||||
// PR c++/50961
|
||||
|
||||
template < class > void foo ();
|
||||
|
||||
bool b1 = !foo<void>;
|
||||
bool b2 = foo<void> ? true : false;
|
||||
|
||||
void bar()
|
||||
{
|
||||
if (foo<void>)
|
||||
;
|
||||
}
|
Loading…
Reference in New Issue
Block a user