Commit af5216d3 by Paolo Carlini Committed by Paolo Carlini

re PR c++/36760 (Simple std::bind use causes warnings with -Wextra)

/cp
2008-07-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/36760
	* pt.c (tsubst_function_type): Don't warn for type qualifiers
	on function return type in case of system header.

/testsuite
2008-07-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/36760
	* g++.dg/warn/pragma-system_header5.C: New.
	* g++.dg/warn/pragma-system_header5.h: Likewise.

From-SVN: r137660
parent 361eefe7
2008-07-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/36760
* pt.c (tsubst_function_type): Don't warn for type qualifiers
on function return type in case of system header.
2008-07-09 Raksit Ashok <raksit@google.com>
* parser.c (cp_parser_postfix_expression): New warning based on flag
......
......@@ -8768,6 +8768,7 @@ tsubst_function_type (tree t,
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");
......
2008-07-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/36760
* g++.dg/warn/pragma-system_header5.C: New.
* g++.dg/warn/pragma-system_header5.h: Likewise.
2008-07-09 Raksit Ashok <raksit@google.com>
* gcc.dg/wdisallowed-functions-1.c: New test.
......
// PR c++/36760
// { dg-options "-Wextra" }
#include "pragma-system_header5.h"
void f()
{
g<const double>();
g<volatile void>();
}
#pragma GCC system_header
template <typename T> T g();
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