aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2008-06-27 20:45:25 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2008-06-27 20:45:25 +0000
commita7235bfbb1bc521f11932a917de5ce70c69f821b (patch)
tree775a4b1317d2b7d753237f7da1d869ba65dc497f
parentca2b131143a3195e603493aadd0a0b4a18ad737f (diff)
downloadgcc-a7235bfbb1bc521f11932a917de5ce70c69f821b.zip
gcc-a7235bfbb1bc521f11932a917de5ce70c69f821b.tar.gz
gcc-a7235bfbb1bc521f11932a917de5ce70c69f821b.tar.bz2
re PR c++/36655 (unjustified warning for "extern template" when using -pedantic -std=c++0x)
/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
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/extern_template.C4
4 files changed, 17 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index df1a46b..e2368b4 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 9926f3d..3222270 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4ede6da..6d739ff 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..ec2cb78
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/extern_template.C
@@ -0,0 +1,4 @@
+// { dg-options "-std=c++0x -pedantic" }
+
+template <typename> void f() {}
+extern template void f<int>();