mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-26 06:48:51 -04:00

of copy initialization. Other pieces of the puzzle: - Try/Perform-ImplicitConversion now handles implicit conversions that don't involve references. - Try/Perform-CopyInitialization uses CheckSingleAssignmentConstraints for C. PerformCopyInitialization is now used for all argument passing and returning values from a function. - Diagnose errors with declaring references and const values without an initializer. (Uses a new Action callback, ActOnUninitializedDecl). We do not yet have implicit conversion sequences for reference binding, which means that we don't have any overloading support for reference parameters yet. llvm-svn: 58353
20 lines
532 B
C++
20 lines
532 B
C++
// RUN: clang -fsyntax-only -verify %s
|
|
|
|
extern char *bork;
|
|
char *& bar = bork;
|
|
|
|
int val;
|
|
|
|
void foo(int &a) {
|
|
}
|
|
|
|
typedef int & A;
|
|
|
|
void g(const A aref) {
|
|
}
|
|
|
|
int & const X = val; // expected-error {{'const' qualifier may not be applied to a reference}}
|
|
int & volatile Y = val; // expected-error {{'volatile' qualifier may not be applied to a reference}}
|
|
int & const volatile Z = val; /* expected-error {{'const' qualifier may not be applied}} \
|
|
expected-error {{'volatile' qualifier may not be applied}} */
|