blob: 0d2b9d29c369150a5733ec4232098a48b78346e6 [file] [log] [blame]
Daniel Dunbarffd408a2009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Chris Lattner4b009652007-07-25 00:24:17 +00002
3extern char *bork;
4char *& bar = bork;
5
Douglas Gregor81c29152008-10-29 00:13:59 +00006int val;
7
Chris Lattner4b009652007-07-25 00:24:17 +00008void foo(int &a) {
9}
10
11typedef int & A;
12
13void g(const A aref) {
14}
15
Douglas Gregor81c29152008-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}} \
Chris Lattner4b009652007-07-25 00:24:17 +000019 expected-error {{'volatile' qualifier may not be applied}} */
Sebastian Redl4e67adb2009-03-23 00:00:23 +000020
21typedef int && RV; // expected-error {{rvalue references are only allowed in C++0x}}