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]

[Bug c++/16784] New: Wrong warning : control reaches end of non-void function


g++ 3.5, with -Wall, emits a buggy warning for the code below.
g++ 3.4 works fine.

--------------------
struct A {
  A() {}
  ~A() {}
};

int k()
{
  A K;
  bool b;
    
  if ( b ) {
    A G;
    return 0;
  }
  else
    return 0;
}
--------------------

spion@termite:~/GCC> ./Linux/bin/g++ -Wall -c warn_3_5.C
warn_3_5.C: In function `int k()':
warn_3_5.C:17: warning: control reaches end of non-void function

-- 
           Summary: Wrong warning : control reaches end of non-void function
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sylvain dot pion at sophia dot inria dot fr
                CC: gcc-bugs at gcc dot gnu dot org,sylvain dot pion at
                    sophia dot inria dot fr
  GCC host triplet: i686-pc-linux-gnu


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


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