[Bug middle-end/21124] [4.1 regression] bogus "may be used uninitialized" warning

reichelt at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Apr 20 16:04:00 GMT 2005


------- Additional Comments From reichelt at gcc dot gnu dot org  2005-04-20 16:04 -------
Here's an even simpler testcase that triggers the warning with -O, -O2, -O3:

============================================
struct A
{
    const int& i;
    int j;

    A(const int& __i) : i(__i), j(0) {}
};

void foo(const int&);

inline void bar(const A& a) { foo(a.j); }

void baz()
{
    for (int k=0; k<2; ++k)
        bar(A(0));
}
============================================


-- 


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



More information about the Gcc-bugs mailing list