summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-27 20:45:25 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-27 20:45:25 +0000
commitccb8c58abc22373d16480e62b0ad7b6dd8cf5bc8 (patch)
tree775a4b1317d2b7d753237f7da1d869ba65dc497f
parent919041c78aa12eb6523e5616249fa20a3daae39a (diff)
downloadppe42-gcc-ccb8c58abc22373d16480e62b0ad7b6dd8cf5bc8.tar.gz
ppe42-gcc-ccb8c58abc22373d16480e62b0ad7b6dd8cf5bc8.zip
/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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137200 138bc75d-0d04-0410-961f-82ee72b054a4
-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 df1a46bdf94..e2368b462ce 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 9926f3d834f..32222705f8e 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 4ede6dafed7..6d739ff152b 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 00000000000..ec2cb784e19
--- /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>();
OpenPOWER on IntegriCloud