blob: a1c9339cb669bfa78370c4bd4b2f90aafb05f3da [file] [log] [blame]
Richard Smitha2c36462013-04-26 16:15:35 +00001// RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch %s -o %t
2// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t -verify %s
3
4#ifndef HEADER_INCLUDED
5
6#define HEADER_INCLUDED
7
8template<typename T> void f(T t) {
9 auto a = t.x;
10 decltype(auto) b = t.x;
11 auto c = (t.x);
12 decltype(auto) d = (t.x);
13}
14
15#else
16
17struct Z {
18 int x : 5; // expected-note {{bit-field}}
19};
20
21// expected-error@12 {{non-const reference cannot bind to bit-field 'x'}}
22template void f(Z); // expected-note {{in instantiation of}}
23
24#endif