minix/external/bsd/llvm/dist/clang/test/PCH/cxx1y-decltype-auto.cpp
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

24 lines
512 B
C++

// RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch %s -o %t
// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t -verify %s
#ifndef HEADER_INCLUDED
#define HEADER_INCLUDED
template<typename T> void f(T t) {
auto a = t.x;
decltype(auto) b = t.x;
auto c = (t.x);
decltype(auto) d = (t.x);
}
#else
struct Z {
int x : 5; // expected-note {{bit-field}}
};
// expected-error@12 {{non-const reference cannot bind to bit-field 'x'}}
template void f(Z); // expected-note {{in instantiation of}}
#endif