[PATCH] D62645: [Sema] Resolve placeholder types before type deduction to silence spurious `-Warc-repeated-use-of-weak` warnings

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 27 23:06:52 PDT 2019


rjmccall added inline comments.


================
Comment at: lib/Sema/SemaDecl.cpp:11101
+      if (auto *placeholderType = Init->getType()->getAsPlaceholderType())
+        if (placeholderType->getKind() == BuiltinType::PseudoObject) {
+          Res = CheckPlaceholderExpr(Init).get();
----------------
ahatanak wrote:
> rjmccall wrote:
> > `if (Init->hasPlaceholderType(BuiltinType::PseudoObject))`
> > 
> > Although maybe this should just be `isNonOverloadPlaceholderType()`, since it's the syntactic-only placeholders that we're trying to cover.  (Feel free to add `Expr::hasNonOverloadPlaceholderType()` for convenience.)
> I had to move the code in `deduceVarTypeFromInitializer` that converts `UnknownAnyType` to `id`. The conversion has to happen before `CheckPlaceholderExpr` is called.
Seems reasonable.  Can you do the cleanup I requested?


Repository:
  rC Clang

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

https://reviews.llvm.org/D62645





More information about the cfe-commits mailing list