This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] -pedantic-errors vs. extern template


>>>>> "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));
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]