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.