[PATCH] D118552: [clang] [concepts] Correctly(?) handle placeholder types in ExprRequirements.

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 31 10:42:08 PST 2022


Quuxplusone added inline comments.


================
Comment at: clang/lib/AST/ASTContext.cpp:3373
 ASTContext::getLValueReferenceType(QualType T, bool SpelledAsLValue) const {
-  assert(getCanonicalType(T) != OverloadTy &&
-         "Unresolved overloaded function type");
+  if (T->isPlaceholderType()) {
+    assert(T->isSpecificPlaceholderType(BuiltinType::UnknownAny) &&
----------------
urnathan wrote:
> sorry to be picky, but
>  (a) why the {...} on the single body stmt? Isn't that against style?
>  (b) are we sure the if's condition is sufficiently const so that it goes away when the assert is inactive?  if's containing a single assert make me nervous.
No problem, I'll move the whole thing into the assert, which will fix both points. Ditto line 3414.

(I did it this way originally only for historical reasons, because I had been putting extra code (printf/abort) into the `if` to find out what placeholder types I needed to grandfather in.)


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

https://reviews.llvm.org/D118552



More information about the cfe-commits mailing list