diff --git a/clang-tools-extra/pseudo/lib/cxx.bnf b/clang-tools-extra/pseudo/lib/cxx.bnf --- a/clang-tools-extra/pseudo/lib/cxx.bnf +++ b/clang-tools-extra/pseudo/lib/cxx.bnf @@ -645,7 +645,7 @@ constraint-logical-and-expression := constraint-logical-and-expression && primary-expression template-parameter := type-parameter template-parameter := parameter-declaration -type-parameter := type-parameter-key ..._opt IDENTIFIER +type-parameter := type-parameter-key ..._opt IDENTIFIER_opt type-parameter := type-parameter-key IDENTIFIER_opt = type-id type-parameter := type-constraint ..._opt IDENTIFIER_opt type-parameter := type-constraint IDENTIFIER_opt = type-id diff --git a/clang-tools-extra/pseudo/test/cxx/template-noid-type-parameter.cpp b/clang-tools-extra/pseudo/test/cxx/template-noid-type-parameter.cpp new file mode 100644 --- /dev/null +++ b/clang-tools-extra/pseudo/test/cxx/template-noid-type-parameter.cpp @@ -0,0 +1,3 @@ +// RUN: clang-pseudo -grammar=%cxx-bnf-file -source=%s --print-forest | FileCheck %s +template struct MatchParents; +// CHECK: template-parameter-list~TYPENAME := tok[2]