From 3d7c63cf96836d9894169c11aeb25fc9cbcee827 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 9 Jul 2008 20:52:45 +0000 Subject: [PATCH] re PR c++/36760 (Simple std::bind use causes warnings with -Wextra) /cp 2008-07-09 Paolo Carlini PR c++/36760 * pt.c (tsubst_function_type): Remove warning for type qualifiers on function return type. /testsuite 2008-07-09 Paolo Carlini PR c++/36760 * g++.dg/warn/Wreturn-type-4.C: Adjust. From-SVN: r137672 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/pt.c | 8 -------- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/warn/Wreturn-type-4.C | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b68a7951fd9..2143fe22808 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-07-09 Paolo Carlini + + PR c++/36760 + * pt.c (tsubst_function_type): Remove warning for type qualifiers + on function return type. + 2008-07-09 Paolo Carlini PR c++/36760 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 3fee994a368..b54c9d13e94 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -8765,14 +8765,6 @@ tsubst_function_type (tree t, if (arg_types == error_mark_node) return error_mark_node; - if (TYPE_QUALS (return_type) != TYPE_UNQUALIFIED - && in_decl != NULL_TREE - && !TREE_NO_WARNING (in_decl) - && !DECL_IN_SYSTEM_HEADER (in_decl) - && (SCALAR_TYPE_P (return_type) || VOID_TYPE_P (return_type))) - warning (OPT_Wignored_qualifiers, - "type qualifiers ignored on function return type"); - /* Construct a new type node and return it. */ if (TREE_CODE (t) == FUNCTION_TYPE) fntype = build_function_type (return_type, arg_types); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a71c1ccf2c1..1ddae4ea8ce 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-07-09 Paolo Carlini + + PR c++/36760 + * g++.dg/warn/Wreturn-type-4.C: Adjust. + 2008-07-09 Richard Sandiford PR target/35802 diff --git a/gcc/testsuite/g++.dg/warn/Wreturn-type-4.C b/gcc/testsuite/g++.dg/warn/Wreturn-type-4.C index 20c34a836a9..4f02678e7f9 100644 --- a/gcc/testsuite/g++.dg/warn/Wreturn-type-4.C +++ b/gcc/testsuite/g++.dg/warn/Wreturn-type-4.C @@ -16,7 +16,7 @@ template const T getfoo(const T def) /* { dg-bogus "type qualifiers template class Pair { public: - T getLeft() const { return T(); } /* { dg-warning "type qualifiers ignored" } */ + T getLeft() const { return T(); } /* { dg-bogus "type qualifiers ignored" } */ const T getRight() const { return T(); } /* { dg-bogus "type qualifiers ignored" } */ }; -- 2.30.2