From 3b6444f0aa353487b263e444f2cc5e7ff7b3571a Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 20 Jan 2015 14:19:32 +0000 Subject: [PATCH] re PR c++/64383 (missed warning for unused variable.) 2015-01-20 Paolo Carlini PR c++/64383 * g++.dg/warn/Wunused-var-23.C: New. From-SVN: r219896 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/warn/Wunused-var-23.C | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 gcc/testsuite/g++.dg/warn/Wunused-var-23.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4d45666b0e0..8cf69c1e938 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-01-20 Paolo Carlini + + PR c++/64383 + * g++.dg/warn/Wunused-var-23.C: New. + 2015-01-20 Paolo Carlini PR c++/59937 diff --git a/gcc/testsuite/g++.dg/warn/Wunused-var-23.C b/gcc/testsuite/g++.dg/warn/Wunused-var-23.C new file mode 100644 index 00000000000..baa1d03d46c --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wunused-var-23.C @@ -0,0 +1,17 @@ +// PR c++/64383 +// { dg-options "-Wunused-variable" } + +struct Y +{ + ~Y(); +}; + +struct X +{ + static Y& get(); +}; + +int main() +{ + Y& y = X::get(); // { dg-warning "unused" } +} -- 2.30.2