aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Parser/cxx-reference.cpp
blob: 4f3b58c5d53ecfaff6309faf271dd542950a60b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: clang -fsyntax-only -verify %s

extern char *bork;
char *& bar = bork;

void foo(int &a) {
}

typedef int & A;

void g(const A aref) {
}

int & const X; // expected-error {{'const' qualifier may not be applied to a reference}}
int & volatile Y; // expected-error {{'volatile' qualifier may not be applied to a reference}}
int & const volatile Z; /* expected-error {{'const' qualifier may not be applied}} \
                           expected-error {{'volatile' qualifier may not be applied}} */