re PR c++/84221 (spurious -Wunused warning on a variable of a template type declared...
authorJason Merrill <jason@gcc.gnu.org>
Wed, 4 Apr 2018 19:59:20 +0000 (15:59 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 4 Apr 2018 19:59:20 +0000 (15:59 -0400)
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

index 5558f9361fce0433c3cedbebdaafee908edccf7e..8aaf381ffa62787de1bc0108844f6212f16f442f 100644 (file)
@@ -2,8 +2,10 @@
 // { dg-additional-options -Wunused }
 
 template <class T> struct __attribute((unused)) A { };
+template <> struct A<char> { };
 
 void f (void)
 {
   A<int> a;   // shouldn't warn
+  A<char> ac; // { dg-warning "unused" }
 }