brintos

brintos / llvm-project-archived public Read only

0
0
Text · 667 B · 8a85283 Raw
28 lines · cpp
1// RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch %s -o %t2// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t -verify %s3 4// RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch -fpch-instantiate-templates %s -o %t5// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t -verify %s6 7#ifndef HEADER_INCLUDED8 9#define HEADER_INCLUDED10 11template<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#else19 20struct Z {21  int x : 5; // expected-note {{bit-field}}22};23 24// expected-error@15 {{non-const reference cannot bind to bit-field 'x'}}25template void f(Z); // expected-note {{in instantiation of}}26 27#endif28