GH-786: fix Stmt::As methods casting incomplete types

This commit is contained in:
Jon Siwek 2020-07-02 14:28:28 -07:00
parent c8b6badd54
commit 5cba12444a
2 changed files with 21 additions and 16 deletions

View file

@ -40,23 +40,10 @@ public:
// True if the statement has no side effects, false otherwise.
virtual bool IsPure() const;
StmtList* AsStmtList()
{
CHECK_TAG(tag, STMT_LIST, "Stmt::AsStmtList", stmt_name)
return (StmtList*) this;
}
StmtList* AsStmtList();
const StmtList* AsStmtList() const;
const StmtList* AsStmtList() const
{
CHECK_TAG(tag, STMT_LIST, "Stmt::AsStmtList", stmt_name)
return (const StmtList*) this;
}
ForStmt* AsForStmt()
{
CHECK_TAG(tag, STMT_FOR, "Stmt::AsForStmt", stmt_name)
return (ForStmt*) this;
}
ForStmt* AsForStmt();
void RegisterAccess() const { last_access = network_time; access_count++; }
void AccessStats(ODesc* d) const;