Skip to content

Commit

Permalink
Fix duplicated Typeid() function declarations problem
Browse files Browse the repository at this point in the history
[issue](antlr/antlr4#2353)
we would got an redeclaration error sicne the difference between old two functions are just return type, that's not enought to distinguish them by compiler
  • Loading branch information
y1yang0 committed Aug 27, 2018
1 parent 5f93c3f commit 33c5988
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions cpp/CPP14.g4
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,20 @@ postfixexpression
| Static_cast '<' thetypeid '>' '(' expression ')'
| Reinterpret_cast '<' thetypeid '>' '(' expression ')'
| Const_cast '<' thetypeid '>' '(' expression ')'
| Typeid '(' expression ')'
| Typeid '(' thetypeid ')'
| typeidofthetypeid '(' expression ')'
| typeidofthetypeid '(' thetypeid ')'
;

/*
add a middle layer to eliminate duplicated function declarations
*/
typeidofexpr
:
Typeid
;
typeidofthetypeid
:
Typeid
;

expressionlist
Expand Down

0 comments on commit 33c5988

Please sign in to comment.