Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / g++.dg / template / error34.C
blobd0cbcaef28e92a71b9b420c3850605bdf6d18754
1 // PR c++/33842
2 // { dg-do compile }
4 template<typename T> struct A
6   A<__builtin_offsetof(T, x)>();        // { dg-error "type/value mismatch|offsetof\\(T, x\\)" }
7 };
9 template<typename T> struct B
11   B<__builtin_offsetof(T, x.y)>();      // { dg-error "type/value mismatch|offsetof\\(T, x.y\\)" }
14 template<typename T> struct C
16   C<__builtin_offsetof(T, x[6])>();     // { dg-error "type/value mismatch|offsetof\\(T, x\\\[6\\\]\\)" }
19 template<typename T> struct D
21   D<__builtin_offsetof(T, x.y[6].z)>(); // { dg-error "type/value mismatch|offsetof\\(T, x.y\\\[6\\\].z\\)" }
24 struct E { int x; };
26 template<typename T> struct F
28   F<__builtin_offsetof(E, x)>();        // { dg-error "type/value mismatch|offsetof\\(E, x\\)" }