This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PING: [PATCH: c++/diagnostic/18313] Warn for pointless qualifiers on return type
Dirk Mueller <dmuell@gmx.net> writes:
| On Tuesday, 14. November 2006 07:51, Gabriel Dos Reis wrote:
|
| > I think we should warn for non-dependent case, and warn only at
| > instantiation time for the dependent case.
|
| Here's a patch that implements the requested behaviour, bootstrapped,
| regtested against r118902 on i686-suse-linux with no additional failures.
|
| Ok for mainline, assuming that it regtests fine as soon as mainline bootstraps
| again?
|
| 2006-11-17 Dirk Mueller <dmueller@suse.de>
|
| PR c++/18313
| * decl.c (grokdeclarator): Warn for type qualifiers on return
| type for non-dependent types.
This change was OK
| * pt.c (tsubst_function_type): Warn for type qualifiers on
| return type for dependent types.
This ChangeLog entry seems to indicate that we warn even for dependent
type, when in fact I was suggesting to warn only for non-dependent type.
That I believe you actually implemented, right?
[...]
| Index: cp/pt.c
| ===================================================================
| --- cp/pt.c (revision 118902)
| +++ cp/pt.c (working copy)
| @@ -7123,6 +7123,12 @@ tsubst_function_type (tree t,
| if (arg_types == error_mark_node)
| return error_mark_node;
|
| + if (TYPE_QUALS (return_type) != TYPE_UNQUALIFIED
| + && !TREE_NO_WARNING (TREE_TYPE (t))
| + && (SCALAR_TYPE_P (return_type) || VOID_TYPE_P (return_type)))
| + warning (OPT_Wreturn_type,
| + "type qualifiers ignored on function return type");
| +
-- gaby