diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2008-06-27 20:45:25 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2008-06-27 20:45:25 +0000 |
commit | a7235bfbb1bc521f11932a917de5ce70c69f821b (patch) | |
tree | 775a4b1317d2b7d753237f7da1d869ba65dc497f /gcc | |
parent | ca2b131143a3195e603493aadd0a0b4a18ad737f (diff) | |
download | gcc-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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/extern_template.C | 4 |
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>(); |