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++/64383] missed warning for unused variable.


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64383

--- Comment #2 from Pawel Sikora <pluto at agmk dot net> ---
(In reply to Manuel LÃpez-IbÃÃez from comment #1)
> A minimized testcase would be helpful. Using delta would probably remove
> already a lot: https://gcc.gnu.org/wiki/A_guide_to_testcase_reduction


one more small testcase w/o stl with missed warning.

struct Y
{
    ~Y(); // comment this line to get proper warning about 'unused y variable'
};
struct X
{
    static Y& get();
};
int main()
{
    Y& y = X::get();
}

clang 3.5.0 warns in both (w/ and w/o Y dtor) variants.

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