Skip to content
Snippets Groups Projects
Commit 8141f496 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Warn for invalid references.

parent a2c4dee4
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment