public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17449] New: Cannot shut warning off
@ 2004-09-13  1:19 igodard at pacbell dot net
  2004-09-13  1:34 ` [Bug c++/17449] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: igodard at pacbell dot net @ 2004-09-13  1:19 UTC (permalink / raw)
  To: gcc-bugs

struct B;
template<typename T> struct A {
    friend
    A&  operator <<(A& a, B b);
    };
int main() {
    return 0; }

-- 
           Summary: Cannot shut warning off
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17449


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/17449] Cannot shut warning off
  2004-09-13  1:19 [Bug c++/17449] New: Cannot shut warning off igodard at pacbell dot net
@ 2004-09-13  1:34 ` pinskia at gcc dot gnu dot org
  2004-09-13  7:25 ` igodard at pacbell dot net
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-13  1:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-13 01:33 -------
Huh, the warning gives how to shut off the warning:
pr17449.cc:4: warning: friend declaration `A<T>& operator<<(A<T>&, B)' declares a non-template 
function
pr17449.cc:4: warning: (if this is not what you intended, make sure the function template has already 
been declared and add <> after the function name here) -Wno-non-template-friend disables this 
warning

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17449


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/17449] Cannot shut warning off
  2004-09-13  1:19 [Bug c++/17449] New: Cannot shut warning off igodard at pacbell dot net
  2004-09-13  1:34 ` [Bug c++/17449] " pinskia at gcc dot gnu dot org
@ 2004-09-13  7:25 ` igodard at pacbell dot net
  2004-09-13 14:09 ` bangerth at dealii dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: igodard at pacbell dot net @ 2004-09-13  7:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From igodard at pacbell dot net  2004-09-13 07:25 -------
Yes, it says how to declare a template function here. But when I *do* want to declare a non-template function here then I can't shut the warning off.

Or am I completely misunderstanding the warning? The goal here is to have only one particular instantiation of the function be the friend of any particular instantiation of the class, not *all* instantiations of the function being friends of *every* instantiation of the class, as declaring a template function as friend would do. I think :-)

BTW Comeau is happy, neither warning nor error.

Ivan

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17449


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/17449] Cannot shut warning off
  2004-09-13  1:19 [Bug c++/17449] New: Cannot shut warning off igodard at pacbell dot net
  2004-09-13  1:34 ` [Bug c++/17449] " pinskia at gcc dot gnu dot org
  2004-09-13  7:25 ` igodard at pacbell dot net
@ 2004-09-13 14:09 ` bangerth at dealii dot org
  2004-09-13 16:01 ` igodard at pacbell dot net
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-09-13 14:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-09-13 14:09 -------
Uhm, the last line of the warning message says: 
  -Wno-non-template-friend disables this warning 
And it indeed does. What's wrong with this? 
 
W. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17449


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/17449] Cannot shut warning off
  2004-09-13  1:19 [Bug c++/17449] New: Cannot shut warning off igodard at pacbell dot net
                   ` (2 preceding siblings ...)
  2004-09-13 14:09 ` bangerth at dealii dot org
@ 2004-09-13 16:01 ` igodard at pacbell dot net
  2004-09-13 16:07 ` igodard at pacbell dot net
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: igodard at pacbell dot net @ 2004-09-13 16:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From igodard at pacbell dot net  2004-09-13 16:01 -------
Sorry guys. I went and read the doc looking for the shut-off option, and didn't see it right in the message :-(.

Please change this bug# to a documentation report - the shit-off option doesn't appear in the list of warning-control options.

Unless I missed it there too :0(

Ivan
(egg on face)

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17449


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/17449] Cannot shut warning off
  2004-09-13  1:19 [Bug c++/17449] New: Cannot shut warning off igodard at pacbell dot net
                   ` (3 preceding siblings ...)
  2004-09-13 16:01 ` igodard at pacbell dot net
@ 2004-09-13 16:07 ` igodard at pacbell dot net
  2004-09-13 16:20 ` bangerth at dealii dot org
  2004-09-13 20:50 ` igodard at pacbell dot net
  6 siblings, 0 replies; 8+ messages in thread
From: igodard at pacbell dot net @ 2004-09-13 16:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From igodard at pacbell dot net  2004-09-13 16:07 -------
Er - "shit-off" should be "shut-off" 

Ivan

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17449


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/17449] Cannot shut warning off
  2004-09-13  1:19 [Bug c++/17449] New: Cannot shut warning off igodard at pacbell dot net
                   ` (4 preceding siblings ...)
  2004-09-13 16:07 ` igodard at pacbell dot net
@ 2004-09-13 16:20 ` bangerth at dealii dot org
  2004-09-13 20:50 ` igodard at pacbell dot net
  6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-09-13 16:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-09-13 16:20 -------
Err, the manual says: 
 
@item -Wno-non-template-friend @r{(C++ only)} 
@opindex Wno-non-template-friend 
Disable warnings when non-templatized friend functions are declared 
within a template.  Since the advent of explicit template specification 
support in G++, if the name of the friend is an unqualified-id (i.e., 
@samp{friend foo(int)}), the C++ language specification demands that the 
friend declare or define an ordinary, nontemplate function.  (Section 
14.5.3).  Before G++ implemented explicit specification, unqualified-ids 
could be interpreted as a particular specialization of a templatized 
function.  Because this non-conforming behavior is no longer the default 
behavior for G++, @option{-Wnon-template-friend} allows the compiler to 
check existing code for potential trouble spots and is on by default. 
This new compiler behavior can be turned off with 
@option{-Wno-non-template-friend} which keeps the conformant compiler code 
but disables the helpful warning. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17449


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/17449] Cannot shut warning off
  2004-09-13  1:19 [Bug c++/17449] New: Cannot shut warning off igodard at pacbell dot net
                   ` (5 preceding siblings ...)
  2004-09-13 16:20 ` bangerth at dealii dot org
@ 2004-09-13 20:50 ` igodard at pacbell dot net
  6 siblings, 0 replies; 8+ messages in thread
From: igodard at pacbell dot net @ 2004-09-13 20:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From igodard at pacbell dot net  2004-09-13 20:50 -------
We seem to be looking at different manuals. I'm looking at 
http://gcc.gnu.org/onlinedocs/gcc-3.4.1/gcc/Warning-Options.html#Warning%20Options,  
reached by http://gcc.gnu.org/->manual->GCC 3.4.1 Manual->GCC Command Options->Options to Request or Suppress Warnings, and the no-non-template-friend 
warning does not exist on that page (nor does a search show anything else with 
related information). What manual are you looking at? If the problem is that the 
web page doesn't reflect the underlying document, is this simething for Bufzulla?

I
van

(manual CRs)

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17449


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-09-13 20:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-13  1:19 [Bug c++/17449] New: Cannot shut warning off igodard at pacbell dot net
2004-09-13  1:34 ` [Bug c++/17449] " pinskia at gcc dot gnu dot org
2004-09-13  7:25 ` igodard at pacbell dot net
2004-09-13 14:09 ` bangerth at dealii dot org
2004-09-13 16:01 ` igodard at pacbell dot net
2004-09-13 16:07 ` igodard at pacbell dot net
2004-09-13 16:20 ` bangerth at dealii dot org
2004-09-13 20:50 ` igodard at pacbell dot net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).