Commit a7235bfb by Paolo Carlini Committed by Paolo Carlini

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
parent ca2b1311
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> 2008-06-24 Jonathan Wakely <jwakely.gcc@gmail.com>
PR c++/23194 PR c++/23194
......
...@@ -14588,8 +14588,8 @@ do_decl_instantiation (tree decl, tree storage) ...@@ -14588,8 +14588,8 @@ do_decl_instantiation (tree decl, tree storage)
; ;
else if (storage == ridpointers[(int) RID_EXTERN]) else if (storage == ridpointers[(int) RID_EXTERN])
{ {
if (pedantic && !in_system_header) if (pedantic && !in_system_header && (cxx_dialect == cxx98))
pedwarn ("ISO C++ forbids the use of %<extern%> on explicit " pedwarn ("ISO C++ 1998 forbids the use of %<extern%> on explicit "
"instantiations"); "instantiations");
extern_p = 1; extern_p = 1;
} }
......
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> 2008-06-27 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/gomp/pr27388-3.c: Adjust dg-final. * gcc.dg/gomp/pr27388-3.c: Adjust dg-final.
......
// { dg-options "-std=c++0x -pedantic" }
template <typename> void f() {}
extern template void f<int>();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment