diff options
author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-04 23:04:18 +0000 |
---|---|---|
committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-04 23:04:18 +0000 |
commit | d85a20139d881d9d1adab64ffc7305cb3ae98e2a (patch) | |
tree | 0f4ef35ecb306a63e1426bcc2ec3b362210eccfe /gcc/cp/cvt.c | |
parent | 4d4ec3c86cac3f21e5908f762285a995b69dd4e2 (diff) | |
parent | 7d500d30a2205a6e6e6783a4b92cc38d66f3b70b (diff) | |
download | gcc-d85a20139d881d9d1adab64ffc7305cb3ae98e2a.tar.gz |
Merge in trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@202265 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 5cae99c41e3..0efb5548528 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -1589,17 +1589,6 @@ build_expr_type_conversion (int desires, tree expr, bool complain) if (DECL_NONCONVERTING_P (cand)) continue; - if (TREE_CODE (cand) == TEMPLATE_DECL) - { - if (complain) - { - error ("ambiguous default type conversion from %qT", - basetype); - error (" candidate conversions include %qD", cand); - } - return error_mark_node; - } - candidate = non_reference (TREE_TYPE (TREE_TYPE (cand))); switch (TREE_CODE (candidate)) @@ -1633,11 +1622,23 @@ build_expr_type_conversion (int desires, tree expr, bool complain) break; default: + /* A wildcard could be instantiated to match any desired + type, but we can't deduce the template argument. */ + if (WILDCARD_TYPE_P (candidate)) + win = true; break; } if (win) { + if (TREE_CODE (cand) == TEMPLATE_DECL) + { + if (complain) + error ("default type conversion can't deduce template" + " argument for %qD", cand); + return error_mark_node; + } + if (winner) { tree winner_type |