Commit 2d11897a by Jason Merrill Committed by Jason Merrill

PR c++/82219 - bogus -Wignored-qualifiers with template

	* pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Suppress
	-Wignored-qualifiers.

From-SVN: r255279
parent d44e1abe
2017-11-30 Jason Merrill <jason@redhat.com>
PR c++/82219 - bogus -Wignored-qualifiers with template
* pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Suppress
-Wignored-qualifiers.
2017-11-29 David Malcolm <dmalcolm@redhat.com> 2017-11-29 David Malcolm <dmalcolm@redhat.com>
* parser.c (cp_parser_unary_expression): Generate a location for * parser.c (cp_parser_unary_expression): Generate a location for
......
...@@ -17180,6 +17180,7 @@ tsubst_copy_and_build (tree t, ...@@ -17180,6 +17180,7 @@ tsubst_copy_and_build (tree t,
op = RECUR (TREE_OPERAND (t, 0)); op = RECUR (TREE_OPERAND (t, 0));
warning_sentinel s(warn_useless_cast); warning_sentinel s(warn_useless_cast);
warning_sentinel s2(warn_ignored_qualifiers);
switch (TREE_CODE (t)) switch (TREE_CODE (t))
{ {
case CAST_EXPR: case CAST_EXPR:
......
// PR c++/82219
// { dg-additional-options "-Wall -Wextra" }
struct A {
template <typename T> T foo(T *) const { return static_cast<T>(0); }
void bar() const { foo(&i); }
int i;
};
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