Fix a dangerous c-cast in the cpp codegen
This commit is contained in:
parent
3a8ec78de2
commit
c8279a1d89
|
@ -123,3 +123,4 @@ YYYY/MM/DD, github id, Full name, email
|
||||||
2016/11/25, MrSampson, Oliver Sampson, olsam@quickaudio.com
|
2016/11/25, MrSampson, Oliver Sampson, olsam@quickaudio.com
|
||||||
2016/11/29, millergarym, Gary Miller, miller.garym@gmail.com
|
2016/11/29, millergarym, Gary Miller, miller.garym@gmail.com
|
||||||
2016/11/29, wxio, Gary Miller, gm@wx.io
|
2016/11/29, wxio, Gary Miller, gm@wx.io
|
||||||
|
2016/11/29, Naios, Denis Blank, naios@users.noreply.github.com
|
||||||
|
|
|
@ -1048,8 +1048,8 @@ virtual antlrcpp::Any accept(tree::ParseTreeVisitor *visitor) override;
|
||||||
VisitorDispatchMethod(method) ::= <<
|
VisitorDispatchMethod(method) ::= <<
|
||||||
|
|
||||||
antlrcpp::Any <parser.name>::<struct.name>::accept(tree::ParseTreeVisitor *visitor) {
|
antlrcpp::Any <parser.name>::<struct.name>::accept(tree::ParseTreeVisitor *visitor) {
|
||||||
if (dynamic_cast\<<parser.grammarName>Visitor*>(visitor) != nullptr)
|
if (auto parserVisitor = dynamic_cast\<<parser.grammarName>Visitor*>(visitor))
|
||||||
return ((<parser.grammarName>Visitor *)visitor)->visit<struct.derivedFromName; format="cap">(this);
|
return parserVisitor->visit<struct.derivedFromName; format="cap">(this);
|
||||||
else
|
else
|
||||||
return visitor->visitChildren(this);
|
return visitor->visitChildren(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue