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

21 lines
621 B
C++

// RUN: %clang_cc1 -fsyntax-only -verify %s
extern char *bork;
char *& bar = bork;
int val;
void foo(int &a) {
}
typedef int & A;
void g(const A aref) {
}
int & const X = val; // expected-error {{'const' qualifier may not be applied to a reference}}
int & volatile Y = val; // expected-error {{'volatile' qualifier may not be applied to a reference}}
int & const volatile Z = val; /* expected-error {{'const' qualifier may not be applied}} \
expected-error {{'volatile' qualifier may not be applied}} */
typedef int && RV; // expected-warning {{rvalue references are a C++11 extension}}