blob: 8d65defe7df69751575cdc7989b858c0d2760ca3 [file] [log] [blame]
Chris Lattner3b427b32007-10-11 00:18:28 +00001// RUN: clang -fsyntax-only -verify %s
Reid Spencer5f016e22007-07-11 17:01:13 +00002
3extern char *bork;
4char *& bar = bork;
5
Douglas Gregor27c8dc02008-10-29 00:13:59 +00006int val;
7
Reid Spencer5f016e22007-07-11 17:01:13 +00008void foo(int &a) {
9}
10
11typedef int & A;
12
13void g(const A aref) {
14}
15
Douglas Gregor27c8dc02008-10-29 00:13:59 +000016int & 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}} \
Reid Spencer5f016e22007-07-11 17:01:13 +000019 expected-error {{'volatile' qualifier may not be applied}} */