This is the mail archive of the gcc-bugs@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]

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

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


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