brintos

brintos / llvm-project-archived public Read only

0
0
Text · 861 B · 58bd7ab Raw
27 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s3// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s4 5extern char *bork;6char *& bar = bork;7 8int val;9 10void foo(int &a) {11}12 13typedef int & A;14 15void g(const A aref) { // expected-warning {{'const' qualifier on reference type 'A' (aka 'int &') has no effect}}16}17 18int & const X = val; // expected-error {{'const' qualifier may not be applied to a reference}}19int & volatile Y = val; // expected-error {{'volatile' qualifier may not be applied to a reference}}20int & const volatile Z = val; /* expected-error {{'const' qualifier may not be applied}} \21                           expected-error {{'volatile' qualifier may not be applied}} */22 23typedef int && RV; 24#if __cplusplus <= 199711L25// expected-warning@-2 {{rvalue references are a C++11 extension}}26#endif27