5 // Make sure we detect errors on non-type-dependent things
6 // even when the templates are never instantiated.
7 template<typename T> void f1()
10 s += 1; // { dg-error "invalid" }
13 template<typename T> void f2(float *f)
16 *f |= 1; // { dg-error "invalid|evaluation" }
19 // Here the rhs is dependent, but not type dependent.
20 template<typename T> void f3(float *f)
23 *f |= sizeof (T); // { dg-error "invalid|evaluation" }
26 // And the converse, no error here because we're never fed a T.
27 template<typename T> void f4(T *t)
33 // Here we'll let it go, because the rhs is type dependent and
34 // we can't properly instantiate the statement, and we do most
35 // of the semantic analysis concurrent with that.
36 template<typename T> void f5(float *f)
39 *f |= (T)sizeof(T); // { dg-error "invalid|evaluation" "" { xfail *-*-* } }