[PATCH] D144115: [clang] Extend pragma dump to support expressions

Vlad Serebrennikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 23 04:27:42 PDT 2023


Endill added inline comments.


================
Comment at: clang/lib/Parse/ParsePragma.cpp:731-736
+    } else if (E.get()->isTypeDependent()) {
+      PP.Diag(StartLoc, diag::warn_pragma_debug_type_dependent_argument)
+        << SourceRange(StartLoc, Tok.getLocation());
+    } else if (E.get()->isValueDependent()) {
+      PP.Diag(StartLoc, diag::warn_pragma_debug_value_dependent_argument)
+        << SourceRange(StartLoc, Tok.getLocation());
----------------
aaron.ballman wrote:
> Endill wrote:
> > aaron.ballman wrote:
> > > 
> > I see quite a lot of items inside `ExprDependence`. Are you sure we don't miss any corner cases by using `isValueDependent()` to select between value- and type-dependent diagnostic text? 
> I was trying to think of a case where we'd run into problems, but I can't come up with one, so I believe we're fine here.
Apparently, we should do it the other way round, because `An id-expression is value-dependent if: — it is type-dependent` ([[ http://eel.is/c++draft/temp.dep#constexpr-2.2 | temp.dep.constexpr/2.2]]). I observe that in one of the tests I added, `T{}` is TypeValueInstantiation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144115



More information about the cfe-commits mailing list