25 lines · cpp
1// RUN: %clang_cc1 %s -verify -fopenacc2 3template<typename T>4void Func() {5#pragma acc parallel6 typename T::type I; //#ILOC7#pragma acc serial8 typename T::type IS; //#ILOCSERIAL9#pragma acc kernels10 typename T::type IK; //#ILOCKERNELS11}12 13struct S {14 using type = int;15};16 17void use() {18 Func<S>();19 // expected-error@#ILOC{{type 'int' cannot be used prior to '::' because it has no members}}20 // expected-note@+3{{in instantiation of function template specialization 'Func<int>' requested here}}21 // expected-error@#ILOCSERIAL{{type 'int' cannot be used prior to '::' because it has no members}}22 // expected-error@#ILOCKERNELS{{type 'int' cannot be used prior to '::' because it has no members}}23 Func<int>();24}25