From a7235bfbb1bc521f11932a917de5ce70c69f821b Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 27 Jun 2008 20:45:25 +0000 Subject: [PATCH] re PR c++/36655 (unjustified warning for "extern template" when using -pedantic -std=c++0x) /cp 2008-06-27 Paolo Carlini PR c++/36655 * pt.c (do_decl_instantiation): In c++0x mode do not warn for extern template. /testsuite 2008-06-27 Paolo Carlini PR c++/36655 * g++.dg/cpp0x/extern_template.C: New. From-SVN: r137200 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/pt.c | 4 ++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/extern_template.C | 4 ++++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/extern_template.C 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 + + PR c++/36655 + * pt.c (do_decl_instantiation): In c++0x mode do not warn for + extern template. + 2008-06-24 Jonathan Wakely 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 % on explicit " + if (pedantic && !in_system_header && (cxx_dialect == cxx98)) + pedwarn ("ISO C++ 1998 forbids the use of % 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 + + PR c++/36655 + * g++.dg/cpp0x/extern_template.C: New. + 2008-06-27 Jakub Jelinek * 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 void f() {} +extern template void f(); -- 2.30.2