comparison gcc/testsuite/g++.dg/template/error34.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 // PR c++/33842
2 // { dg-do compile }
3
4 template<typename T> struct A
5 {
6 A<__builtin_offsetof(T, x)>(); // { dg-error "type/value mismatch|offsetof\\(T, x\\)" }
7 };
8
9 template<typename T> struct B
10 {
11 B<__builtin_offsetof(T, x.y)>(); // { dg-error "type/value mismatch|offsetof\\(T, x.y\\)" }
12 };
13
14 template<typename T> struct C
15 {
16 C<__builtin_offsetof(T, x[6])>(); // { dg-error "type/value mismatch|offsetof\\(T, x\\\[6\\\]\\)" }
17 };
18
19 template<typename T> struct D
20 {
21 D<__builtin_offsetof(T, x.y[6].z)>(); // { dg-error "type/value mismatch|offsetof\\(T, x.y\\\[6\\\].z\\)" }
22 };
23
24 struct E { int x; };
25
26 template<typename T> struct F
27 {
28 F<__builtin_offsetof(E, x)>(); // { dg-error "type/value mismatch|offsetof\\(E, x\\)" }
29 };