Chris Lattner | 3b427b3 | 2007-10-11 00:18:28 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 2 | |
| 3 | extern char *bork; |
| 4 | char *& bar = bork; |
| 5 | |
| 6 | void foo(int &a) { |
| 7 | } |
| 8 | |
| 9 | typedef int & A; |
| 10 | |
| 11 | void g(const A aref) { |
| 12 | } |
| 13 | |
| 14 | int & const X; // expected-error {{'const' qualifier may not be applied to a reference}} |
| 15 | int & volatile Y; // expected-error {{'volatile' qualifier may not be applied to a reference}} |
| 16 | int & const volatile Z; /* expected-error {{'const' qualifier may not be applied}} \ |
| 17 | expected-error {{'volatile' qualifier may not be applied}} */ |