diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-03-23 12:27:09 +0100 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-03-23 12:27:09 +0100 |
commit | 8141f496ffee4d70b3563e2a3b091b1826a7859f (patch) | |
tree | f4c1bbbf4778be3761a41ce180e569ad60b19ca7 | |
parent | a2c4dee44f0a86b5cc303d84fb577eeffbe4ae09 (diff) | |
download | qt-creator-8141f496ffee4d70b3563e2a3b091b1826a7859f.tar.gz |
Warn for invalid references.
-rw-r--r-- | src/shared/cplusplus/CheckDeclarator.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared/cplusplus/CheckDeclarator.cpp b/src/shared/cplusplus/CheckDeclarator.cpp index 86e3541d56..44aaf32a0b 100644 --- a/src/shared/cplusplus/CheckDeclarator.cpp +++ b/src/shared/cplusplus/CheckDeclarator.cpp @@ -241,6 +241,9 @@ bool CheckDeclarator::visit(ReferenceAST *ast) { const bool rvalueRef = (tokenKind(ast->reference_token) == T_AMPER_AMPER); + if (_fullySpecifiedType->isReferenceType()) + translationUnit()->error(ast->firstToken(), "cannot declare reference to a reference"); + ReferenceType *refTy = control()->referenceType(_fullySpecifiedType, rvalueRef); FullySpecifiedType ty(refTy); _fullySpecifiedType = ty; |