From 01e1df9ff6f1742b31a033fdb65c8ebb5ea0e983 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 4 Apr 2018 15:59:20 -0400 Subject: [PATCH] re PR c++/84221 (spurious -Wunused warning on a variable of a template type declared unused) PR c++/84221 * g++.dg/warn/Wunused-var-32.C: Test explicit specialization. From-SVN: r259106 --- gcc/testsuite/g++.dg/warn/Wunused-var-32.C | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/testsuite/g++.dg/warn/Wunused-var-32.C b/gcc/testsuite/g++.dg/warn/Wunused-var-32.C index 5558f9361fc..8aaf381ffa6 100644 --- a/gcc/testsuite/g++.dg/warn/Wunused-var-32.C +++ b/gcc/testsuite/g++.dg/warn/Wunused-var-32.C @@ -2,8 +2,10 @@ // { dg-additional-options -Wunused } template struct __attribute((unused)) A { }; +template <> struct A { }; void f (void) { A a; // shouldn't warn + A ac; // { dg-warning "unused" } } -- 2.30.2