re PR c++/36655 (unjustified warning for "extern template" when using -pedantic ...
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 27 Jun 2008 20:45:25 +0000 (20:45 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 27 Jun 2008 20:45:25 +0000 (20:45 +0000)
/cp
2008-06-27  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/36655
* pt.c (do_decl_instantiation): In c++0x mode do not warn for
extern template.

/testsuite
2008-06-27  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/36655
* g++.dg/cpp0x/extern_template.C: New.

From-SVN: r137200

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/extern_template.C [new file with mode: 0644]

index df1a46bdf945d0f030d733d28d104d0ba2073df0..e2368b462ce73dde0887a99dad543c1777f16781 100644 (file)
@@ -1,3 +1,9 @@
+2008-06-27  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/36655
+       * pt.c (do_decl_instantiation): In c++0x mode do not warn for
+       extern template.
+
 2008-06-24  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
        PR c++/23194
index 9926f3d834fd553abfef9d5f375ce38785ba7e4e..32222705f8e8299f4d6a5100ae2c6f6f805b56c3 100644 (file)
@@ -14588,8 +14588,8 @@ do_decl_instantiation (tree decl, tree storage)
     ;
   else if (storage == ridpointers[(int) RID_EXTERN])
     {
-      if (pedantic && !in_system_header)
-       pedwarn ("ISO C++ forbids the use of %<extern%> on explicit "
+      if (pedantic && !in_system_header && (cxx_dialect == cxx98))
+       pedwarn ("ISO C++ 1998 forbids the use of %<extern%> on explicit "
                 "instantiations");
       extern_p = 1;
     }
index 4ede6dafed7ae068067b8943220a65877db135a8..6d739ff152b46953987222db12d7aae5cfad8fd1 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-27  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/36655
+       * g++.dg/cpp0x/extern_template.C: New.
+
 2008-06-27  Jakub Jelinek  <jakub@redhat.com>
 
        * gcc.dg/gomp/pr27388-3.c: Adjust dg-final.
diff --git a/gcc/testsuite/g++.dg/cpp0x/extern_template.C b/gcc/testsuite/g++.dg/cpp0x/extern_template.C
new file mode 100644 (file)
index 0000000..ec2cb78
--- /dev/null
@@ -0,0 +1,4 @@
+// { dg-options "-std=c++0x -pedantic" }
+
+template <typename> void f() {}
+extern template void f<int>();