public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/8057: Templates/non-templates and warnings about statements without effects
@ 2002-09-28 6:45 lerdsuwa
0 siblings, 0 replies; 2+ messages in thread
From: lerdsuwa @ 2002-09-28 6:45 UTC (permalink / raw)
To: bangerth, gcc-bugs, gcc-prs, nobody
Synopsis: Templates/non-templates and warnings about statements without effects
State-Changed-From-To: open->analyzed
State-Changed-By: lerdsuwa
State-Changed-When: Sat Sep 28 06:45:47 2002
State-Changed-Why:
Confirmed.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8057
^ permalink raw reply [flat|nested] 2+ messages in thread
* c++/8057: Templates/non-templates and warnings about statements without effects
@ 2002-09-26 11:56 bangerth
0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2002-09-26 11:56 UTC (permalink / raw)
To: gcc-gnats
>Number: 8057
>Category: c++
>Synopsis: Templates/non-templates and warnings about statements without effects
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Sep 26 11:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: unknown-1.0
>Organization:
>Environment:
gcc 3.2
>Description:
In the following snippet
------------------------------
struct Y { static int i; };
template <typename T> class X {
X () { Y::i; };
};
template class X<int>;
class Z {
Z () { Y::i; };
};
--------------------------------
both the constructors of X and Z access Y::i, in a statement
without effect. This is the error message displayed with
gcc3.2:
--------------------------------
> > /home/bangerth/bin/gcc-3.2/bin/g++ -o /dev/null -W -Wall -c y.cc
y.cc: In constructor `X<T>::X() [with T = int]':
y.cc:4: instantiated from `X<T>::X() [with T = int]'
y.cc:6: instantiated from here
y.cc:4: warning: statement with no effect
y.cc: In constructor `X<T>::X() [with T = int]':
y.cc:4: warning: statement with no effect
----------------------------------------------
In other words: the compiler warns twice about that
statement in the template class but not at all in the
non-template. This is, well, confusing.
Regards
Wolfgang
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-09-28 13:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-28 6:45 c++/8057: Templates/non-templates and warnings about statements without effects lerdsuwa
-- strict thread matches above, loose matches on Subject: below --
2002-09-26 11:56 bangerth
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).