re PR c++/36760 (Simple std::bind use causes warnings with -Wextra)
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 9 Jul 2008 15:45:50 +0000 (15:45 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 9 Jul 2008 15:45:50 +0000 (15:45 +0000)
/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

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/pragma-system_header5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/pragma-system_header5.h [new file with mode: 0644]

index fa4419e998a472e7722a133dd7e818cfe4a661cd..b68a7951fd977d8f247bb9bbbf43551de7d332d0 100644 (file)
@@ -1,3 +1,9 @@
+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
index cce706f0705d3f1ce3fb0aa6db44a93ac2a5bf83..3fee994a368861e9b1d6d858bc3091756aecaaef 100644 (file)
@@ -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");
index 755f8e4719c956aa60b9dfe918cd28474a94188f..196c3fa2f87fc92c98d67125761cc59e4177ed56 100644 (file)
@@ -1,3 +1,9 @@
+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.
diff --git a/gcc/testsuite/g++.dg/warn/pragma-system_header5.C b/gcc/testsuite/g++.dg/warn/pragma-system_header5.C
new file mode 100644 (file)
index 0000000..771db3d
--- /dev/null
@@ -0,0 +1,10 @@
+// PR c++/36760
+// { dg-options "-Wextra" }
+
+#include "pragma-system_header5.h"
+
+void f()
+{
+  g<const double>();
+  g<volatile void>();
+}
diff --git a/gcc/testsuite/g++.dg/warn/pragma-system_header5.h b/gcc/testsuite/g++.dg/warn/pragma-system_header5.h
new file mode 100644 (file)
index 0000000..5732e4a
--- /dev/null
@@ -0,0 +1,3 @@
+#pragma GCC system_header
+
+template <typename T> T g();