diff options
author | Patrick Palka <ppalka@gcc.gnu.org> | 2016-03-01 01:24:44 +0000 |
---|---|---|
committer | Patrick Palka <ppalka@gcc.gnu.org> | 2016-03-01 01:24:44 +0000 |
commit | 76d881bfdde273435570ac45dca11e46b27763d0 (patch) | |
tree | 2d98873d48f01b32358a9133eb43aabdd880d778 /gcc/cp/pt.c | |
parent | 7168133a372e15373f3687d9b5e01ce24a954de9 (diff) | |
download | gcc-76d881bfdde273435570ac45dca11e46b27763d0.zip gcc-76d881bfdde273435570ac45dca11e46b27763d0.tar.gz gcc-76d881bfdde273435570ac45dca11e46b27763d0.tar.bz2 |
Fix PR c++/69961 (invalid ctor call with dependent args)
gcc/cp/ChangeLog:
PR c++/68948
PR c++/69961
* pt.c (tsubst_baselink): Reinstate the check for an invalid
constructor call.
gcc/testsuite/ChangeLog:
PR c++/69961
* g++.dg/template/pr69961a.C: New test.
* g++.dg/template/pr69961b.C: New test.
From-SVN: r233838
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b5855a8..b3681be 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -13622,7 +13622,15 @@ tsubst_baselink (tree baselink, tree object_type, name = mangle_conv_op_name_for_type (optype); baselink = lookup_fnfields (qualifying_scope, name, /*protect=*/1); if (!baselink) - return error_mark_node; + { + if (constructor_name_p (name, qualifying_scope)) + { + if (complain & tf_error) + error ("cannot call constructor %<%T::%D%> directly", + qualifying_scope, name); + } + return error_mark_node; + } /* If lookup found a single function, mark it as used at this point. (If it lookup found multiple functions the one selected |