Commit 8141f496 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Warn for invalid references.

parent a2c4dee4
......@@ -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;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment