summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c13
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/extern_template-1.C (renamed from gcc/testsuite/g++.dg/cpp0x/extern_template.C)0
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/extern_template-2.C4
5 files changed, 28 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 50117700c41..5897d1b5a74 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/36655
+ * pt.c (do_type_instantiation): In c++0x mode do not warn for
+ extern template.
+
2008-06-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Make-lang.in (cp-warn): Delete $(CXX_COMPAT_WARN).
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 32222705f8e..f24b6ff04b3 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -14676,8 +14676,17 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain)
if (storage != NULL_TREE)
{
if (pedantic && !in_system_header)
- pedwarn("ISO C++ forbids the use of %qE on explicit instantiations",
- storage);
+ {
+ if (storage == ridpointers[(int) RID_EXTERN])
+ {
+ if (cxx_dialect == cxx98)
+ pedwarn("ISO C++ 1998 forbids the use of %<extern%> on "
+ "explicit instantiations");
+ }
+ else
+ pedwarn("ISO C++ forbids the use of %qE on explicit "
+ "instantiations", storage);
+ }
if (storage == ridpointers[(int) RID_INLINE])
nomem_p = 1;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f2fbbb0f95c..e1c86aeff2d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2008-06-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/36655
+ * g++.dg/cpp0x/extern_template-2.C: New.
+ * g++.dg/cpp0x/extern_template.C: Rename to...
+ * g++.dg/cpp0x/extern_template-1.C: ... this.
+
2008-06-29 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/36341
diff --git a/gcc/testsuite/g++.dg/cpp0x/extern_template.C b/gcc/testsuite/g++.dg/cpp0x/extern_template-1.C
index ec2cb784e19..ec2cb784e19 100644
--- a/gcc/testsuite/g++.dg/cpp0x/extern_template.C
+++ b/gcc/testsuite/g++.dg/cpp0x/extern_template-1.C
diff --git a/gcc/testsuite/g++.dg/cpp0x/extern_template-2.C b/gcc/testsuite/g++.dg/cpp0x/extern_template-2.C
new file mode 100644
index 00000000000..89a9ceb5a77
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/extern_template-2.C
@@ -0,0 +1,4 @@
+// { dg-options "-std=c++0x -pedantic" }
+
+template <typename> class S {};
+extern template class S<int>;
OpenPOWER on IntegriCloud