summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/noeffect7.C
blob: 4aca2496c5eebf07320197789c8839894250515e (plain)
1
2
3
4
5
6
7
8
// PR c++/8057
// Don't give a "statement has no effect" warning when declaring a
// template, only when instantiating it.
// { dg-do compile }
// { dg-options "-Wunused" }
struct Y { static int i; };
template <typename T> class X { X() { Y::i; }; };
class Z { Z() { Y::i; }; }; // { dg-warning "no effect" }