c++/4872: missed warning (no return) -- regression from 2.95

bh@techhouse.brown.edu bh@techhouse.brown.edu
Fri Nov 2 07:56:00 GMT 2001


>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:



More information about the Gcc-bugs mailing list