diff --git a/cpp/CPP14.g4 b/cpp/CPP14.g4 index a83e33fbc1..f61ed501f2 100644 --- a/cpp/CPP14.g4 +++ b/cpp/CPP14.g4 @@ -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