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