Commit 5ebcc547 by Jason Merrill Committed by Jason Merrill

PR c++/70844 - -Wuseless-cast and inheriting constructor.

	* method.c (forward_parm): Suppress warn_useless_cast.

From-SVN: r249344
parent 28ab5c5e
2017-06-17 Jason Merrill <jason@redhat.com>
PR c++/70844 - -Wuseless-cast and inheriting constructor.
* method.c (forward_parm): Suppress warn_useless_cast.
2017-06-16 Jason Merrill <jason@redhat.com> 2017-06-16 Jason Merrill <jason@redhat.com>
PR c++/81045 - Wrong type-dependence with auto return type. PR c++/81045 - Wrong type-dependence with auto return type.
......
...@@ -486,6 +486,7 @@ forward_parm (tree parm) ...@@ -486,6 +486,7 @@ forward_parm (tree parm)
type = PACK_EXPANSION_PATTERN (type); type = PACK_EXPANSION_PATTERN (type);
if (TREE_CODE (type) != REFERENCE_TYPE) if (TREE_CODE (type) != REFERENCE_TYPE)
type = cp_build_reference_type (type, /*rval=*/true); type = cp_build_reference_type (type, /*rval=*/true);
warning_sentinel w (warn_useless_cast);
exp = build_static_cast (type, exp, tf_warning_or_error); exp = build_static_cast (type, exp, tf_warning_or_error);
if (DECL_PACK_P (parm)) if (DECL_PACK_P (parm))
exp = make_pack_expansion (exp); exp = make_pack_expansion (exp);
......
// PR c++/70844
// { dg-options -Wuseless-cast }
// { dg-do compile { target c++11 } }
struct base {
base (int const &);
};
struct derived : public base {
using base::base;
};
derived d(0);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment