1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3extern char *bork;
4char *& bar = bork;
5
6int val;
7
8void foo(int &a) {
9}
10
11typedef int & A;
12
13void g(const A aref) { // expected-warning {{'const' qualifier on reference type 'A' (aka 'int &') has no effect}}
14}
15
16int & const X = val; // expected-error {{'const' qualifier may not be applied to a reference}}
17int & volatile Y = val; // expected-error {{'volatile' qualifier may not be applied to a reference}}
18int & const volatile Z = val; /* expected-error {{'const' qualifier may not be applied}} \
19                           expected-error {{'volatile' qualifier may not be applied}} */
20
21typedef int && RV; // expected-warning {{rvalue references are a C++11 extension}}
22