[PATCH] D151587: [clang][ConstantEmitter] have tryEmitPrivate[ForVarInit] try ConstExprEmitter fast-path first

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 21 12:47:10 PDT 2023


nickdesaulniers added a comment.

In D151587#4523571 <https://reviews.llvm.org/D151587#4523571>, @efriedma wrote:

>> restore E->getStorageDuration() == SD_Static check to fix libcxx regressions
>
> Makes sense... but it would be nice to add a testcase for whatever construct was triggering this.



  #include <string>
  #include <tuple>
  constexpr bool test() {
    std::tuple<int, char const*> a = {34, "hello world"};
    std::pair<long, std::string> p;
    p = a;
    return true;
  }
  int main(int, char**) {
    static_assert(test());
    return 0;
  }

was the furthest I was able to reproduce. Not sure we should be using `std::` in clang/test/Sema; wasn't really able to reduce further.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151587



More information about the cfe-commits mailing list