[PATCH] D50360: [Concepts] Requires Expressions

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 15 14:08:51 PST 2020


rsmith added inline comments.


================
Comment at: clang/lib/AST/StmtPrinter.cpp:2296
+      S.flush();
+      if (Buf.find("typename ") != 0)
+        OS << "typename ";
----------------
I can see why this is the most straightforward way to implement this, but ... yuck. Please add a FIXME :)


================
Comment at: clang/lib/AST/StmtProfile.cpp:1363
+      //    expression. It is equivalent to the simple-requirement x++; [...]
+      // We therefore do not profile isSimple() here.
+      ID.AddBoolean(ExprReq->getNoexceptLoc().isValid());
----------------
This means "equivalent to" in the plain English sense, not in the [temp.over.link] sense, and in any case is not normative. The normative rule is the one in [temp.over.link] based on the ODR / token sequence. It'd be fine to profile `isSimple()` if you want to. (But it's not necessary since a `{ expr };` requirement is functionally equivalent to a `expr;` requirement.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D50360





More information about the cfe-commits mailing list