Compiling the code below with -O2 -Wall produces the buggy warning
mentionned in the subject.
g++ 4.1 and 4.3 do not have this problem.

The code below is pretty minimal (extracted from CGAL).
For example, removing the derivation from the Empty_class
removes the buggy warning.

----------------
struct Empty_class {};

struct C : Empty_class {};

struct M {
  static C f() { return C(); }
};

struct R {
  C c;

  R() 
    : c(M::f()) {}
};

int main()
{
  R r;
  return 0;
}
--------------------


-- 
           Summary: warning: 'this.0' is used uninitialized in this function
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: 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=31841

Reply via email to