]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: explicit(bool) malfunction with dependent expression [PR95066]
authorMarek Polacek <polacek@redhat.com>
Thu, 11 Jun 2020 20:33:13 +0000 (16:33 -0400)
committerMarek Polacek <polacek@redhat.com>
Thu, 11 Jun 2020 20:33:13 +0000 (16:33 -0400)
commitae275b986b8cc747a5b4f389cb05a71fdee1f886
tree24ec0774b11011e38790aa7c9316916780ce4a6b
parentde946847b7cf88c503c6e843fc6263ef7a1911fc
c++: explicit(bool) malfunction with dependent expression [PR95066]

I forgot to set DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P when merging two
function declarations and as a sad consequence, we never tsubsted
the dependent explicit-specifier in tsubst_function_decl, leading to
disregarding the explicit-specifier altogether, and wrongly accepting
this test.

PR c++/95066
* decl.c (duplicate_decls): Set DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.

* g++.dg/cpp2a/explicit16.C: New test.
gcc/cp/decl.c
gcc/testsuite/g++.dg/cpp2a/explicit16.C [new file with mode: 0644]