Commit 071f8ae3 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Warn for invalid pointer to references.

parent 8141f496
......@@ -230,6 +230,9 @@ bool CheckDeclarator::visit(PointerToMemberAST *ast)
bool CheckDeclarator::visit(PointerAST *ast)
{
if (_fullySpecifiedType->isReferenceType())
translationUnit()->error(ast->firstToken(), "cannot declare pointer to a reference");
PointerType *ptrTy = control()->pointerType(_fullySpecifiedType);
FullySpecifiedType ty(ptrTy);
_fullySpecifiedType = ty;
......
Markdown is supported
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