forked from OSchip/llvm-project
[pseudo] Handle the language predefined identifier __func__
The clang lexer lexes it as a dedicated token kind (rather than identifier), we extend the grammar to handle it. Differential Revision: https://reviews.llvm.org/D126996
This commit is contained in:
parent
9b3712e0bf
commit
90dab0473e
|
@ -750,3 +750,8 @@ export-keyword := IDENTIFIER
|
|||
#! split it into two tokens to make the GLR parser aware of the nested-template
|
||||
#! case.
|
||||
greatergreater := > >
|
||||
|
||||
#! C++ predefined identifier, __func__ [dcl.fct.def.general] p8
|
||||
#! FIXME: add other (MSVC, GNU extension) predefined identifiers.
|
||||
primary-expression := predefined-expression
|
||||
predefined-expression := __FUNC__
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
// RUN: clang-pseudo -grammar=%cxx-bnf-file -source=%s --print-forest | FileCheck %s
|
||||
void s() {
|
||||
__func__;
|
||||
// CHECK: expression~__FUNC__ := tok[5]
|
||||
}
|
Loading…
Reference in New Issue