Distinguish between dereferencing pointers and references.
We now have separate Expr implementations for dereferencing pointers and automatically dereferencing references. This is in particular necessary so that we can detect attempts to dereference references with the '*' operator in programs and issue an error in that case. Fixes issue #192.
This commit is contained in:
2
stmt.cpp
2
stmt.cpp
@@ -2426,7 +2426,7 @@ lProcessPrintArg(Expr *expr, FunctionEmitContext *ctx, std::string &argTypes) {
|
||||
return NULL;
|
||||
|
||||
if (dynamic_cast<const ReferenceType *>(type) != NULL) {
|
||||
expr = new DereferenceExpr(expr, expr->pos);
|
||||
expr = new RefDerefExpr(expr, expr->pos);
|
||||
type = expr->GetType();
|
||||
if (type == NULL)
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user