This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [v3] -pedantic-errors vs. extern template
- From: Jason Merrill <jason at redhat dot com>
- To: David Edelsohn <dje at watson dot ibm dot com>
- Cc: bkoz at redhat dot com, gdr at codesourcery dot com, gcc-patches at gcc dot gnu dot org
- Date: Mon, 18 Feb 2002 03:13:52 +0000
- Subject: Re: [v3] -pedantic-errors vs. extern template
- References: <200202180217.VAA26666@makai.watson.ibm.com>
>>>>> "David" == David Edelsohn <dje@watson.ibm.com> writes:
> Ah, in_system_header is just per file and sets
> DECL_IN_SYSTEM_HEADER. Okay, nevermind.
No, I think you were right; we're interested in where the directive is
located, not the template declaration. I'm checking this in:
2002-02-18 Jason Merrill <jason@redhat.com>
* pt.c (do_type_instantiation): Don't pedwarn if in_system_header.
(do_decl_instantiation): Likewise.
*** pt.c.~1~ Mon Feb 18 03:12:03 2002
--- pt.c Mon Feb 18 03:03:12 2002
*************** do_decl_instantiation (declspecs, declar
*** 9502,9508 ****
;
else if (storage == ridpointers[(int) RID_EXTERN])
{
! if (pedantic)
pedwarn ("ISO C++ forbids the use of `extern' on explicit instantiations");
extern_p = 1;
}
--- 9502,9508 ----
;
else if (storage == ridpointers[(int) RID_EXTERN])
{
! if (pedantic && !in_system_header)
pedwarn ("ISO C++ forbids the use of `extern' on explicit instantiations");
extern_p = 1;
}
*************** do_type_instantiation (t, storage, compl
*** 9573,9579 ****
if (storage != NULL_TREE)
{
! if (pedantic)
pedwarn("ISO C++ forbids the use of `%s' on explicit instantiations",
IDENTIFIER_POINTER (storage));
--- 9573,9579 ----
if (storage != NULL_TREE)
{
! if (pedantic && !in_system_header)
pedwarn("ISO C++ forbids the use of `%s' on explicit instantiations",
IDENTIFIER_POINTER (storage));