| 1 |
// 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 |
// RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch -fpch-instantiate-templates %s -o %t |
| 5 |
// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t -verify %s |
| 6 |
|
| 7 |
#ifndef HEADER_INCLUDED |
| 8 |
|
| 9 |
#define HEADER_INCLUDED |
| 10 |
|
| 11 |
template<typename T> void f(T t) { |
| 12 |
auto a = t.x; |
| 13 |
decltype(auto) b = t.x; |
| 14 |
auto c = (t.x); |
| 15 |
decltype(auto) d = (t.x); |
| 16 |
} |
| 17 |
|
| 18 |
#else |
| 19 |
|
| 20 |
struct Z { |
| 21 |
int x : 5; // expected-note {{bit-field}} |
| 22 |
}; |
| 23 |
|
| 24 |
// expected-error@15 {{non-const reference cannot bind to bit-field 'x'}} |
| 25 |
template void f(Z); // expected-note {{in instantiation of}} |
| 26 |
|
| 27 |
#endif |