hokein created this revision.
hokein added a reviewer: sammccall.
Herald added a project: All.
hokein requested review of this revision.
Herald added a subscriber: alextsao1999.
Herald added a project: clang-tools-extra.

The IDENTIFIER should be optional.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126998

Files:
  clang-tools-extra/pseudo/lib/cxx.bnf
  clang-tools-extra/pseudo/test/cxx/template-noid-type-parameter.cpp


Index: clang-tools-extra/pseudo/test/cxx/template-noid-type-parameter.cpp
===================================================================
--- /dev/null
+++ 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 <typename> struct MatchParents;
+// CHECK: template-parameter-list~TYPENAME := tok[2]
Index: clang-tools-extra/pseudo/lib/cxx.bnf
===================================================================
--- clang-tools-extra/pseudo/lib/cxx.bnf
+++ 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


Index: clang-tools-extra/pseudo/test/cxx/template-noid-type-parameter.cpp
===================================================================
--- /dev/null
+++ 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 <typename> struct MatchParents;
+// CHECK: template-parameter-list~TYPENAME := tok[2]
Index: clang-tools-extra/pseudo/lib/cxx.bnf
===================================================================
--- clang-tools-extra/pseudo/lib/cxx.bnf
+++ 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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to