This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/4872: missed warning (no return) -- regression from 2.95
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/4872: missed warning (no return) -- regression from 2.95
- From: bh at techhouse dot brown dot edu
- Date: 14 Nov 2001 03:41:52 -0000
- Reply-to: bh at techhouse dot brown dot edu
[Get raw message]
>Number: 4872
>Category: c++
>Synopsis: missed warning (no return) -- regression from 2.95
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Nov 13 19:46:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: bh@techhouse.brown.edu
>Release: 3.0.1
>Organization:
>Environment:
>Description:
The code in H-T-R should give a warning since the
function doesn't return a value, but no warning
is issued under 3.0.2, 3.0.1 (where it bit me),
or 2.96 (redhat), even with -W -Wall -O2
This is a regression from 2.95.3
>How-To-Repeat:
cat > foo.cpp << EOF
class interval {
public:
interval operator - () {
int tmp = upper_;
upper_ = -lower_;
lower_ = -tmp;
}
private:
unsigned upper_, lower_;
};
EOF
gcc -c foo.cpp -W -Wall -O2
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: