[PATCH] D115521: [Templight] Don't display empty strings for names of unnamed template parameters

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 6 07:50:06 PST 2022


martong added inline comments.


================
Comment at: clang/lib/Frontend/FrontendActions.cpp:501
+
+    if (const auto *Decl = dyn_cast<TagDecl>(NamedTemplate)) {
+      if (const auto *R = dyn_cast<RecordDecl>(Decl)) {
----------------
martong wrote:
> Should this handle `EnumDecl`s as well? An enum declaration itself cannot be a primary template, however, it can be 1) a member of a specialization of a templated class 2)  an instantiation of a member enumeration of a class template specialization.
> 
> 
Should this handle variable templates (VarTemplateDecl) as well? Or it  is not possible to have unnamed variable templates?


================
Comment at: clang/lib/Frontend/FrontendActions.cpp:501-510
+    if (const auto *Decl = dyn_cast<TagDecl>(NamedTemplate)) {
+      if (const auto *R = dyn_cast<RecordDecl>(Decl)) {
+        if (R->isLambda()) {
+          OS << "lambda at ";
+          Decl->getLocation().print(OS, TheSema.getSourceManager());
+          return;
+        }
----------------
Should this handle `EnumDecl`s as well? An enum declaration itself cannot be a primary template, however, it can be 1) a member of a specialization of a templated class 2)  an instantiation of a member enumeration of a class template specialization.




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115521/new/

https://reviews.llvm.org/D115521



More information about the cfe-commits mailing list