This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG90dab0473ef0: [pseudo] Handle the language predefined identifier __func__ (authored by hokein).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126996/new/ https://reviews.llvm.org/D126996 Files: clang-tools-extra/pseudo/lib/cxx.bnf clang-tools-extra/pseudo/test/cxx/predefined-identifier.cpp Index: clang-tools-extra/pseudo/test/cxx/predefined-identifier.cpp =================================================================== --- /dev/null +++ clang-tools-extra/pseudo/test/cxx/predefined-identifier.cpp @@ -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] +} Index: clang-tools-extra/pseudo/lib/cxx.bnf =================================================================== --- clang-tools-extra/pseudo/lib/cxx.bnf +++ clang-tools-extra/pseudo/lib/cxx.bnf @@ -750,3 +750,8 @@ #! 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__
Index: clang-tools-extra/pseudo/test/cxx/predefined-identifier.cpp =================================================================== --- /dev/null +++ clang-tools-extra/pseudo/test/cxx/predefined-identifier.cpp @@ -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] +} Index: clang-tools-extra/pseudo/lib/cxx.bnf =================================================================== --- clang-tools-extra/pseudo/lib/cxx.bnf +++ clang-tools-extra/pseudo/lib/cxx.bnf @@ -750,3 +750,8 @@ #! 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__
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits