aaron.ballman added a subscriber: cpplearner. aaron.ballman added a comment.
Pulling a comment out of https://reviews.llvm.org/D133853 that's relevant here: In D133853#3844851 <https://reviews.llvm.org/D133853#3844851>, @cpplearner wrote: > In D133853#3808674 <https://reviews.llvm.org/D133853#3808674>, @aaron.ballman > wrote: > >> Now I'm wondering why the attribute exists at all. If it's functionally >> equivalent to `constexpr` as a keyword, what are the use cases for the >> attribute? > > It appears that `[[msvc::constexpr]]` does not make a function `constexpr`, > but if `[[msvc::constexpr]]` is used in a function definition //and// in a > call to that function, then the annotated function call can be evaluated > during constant evaluation: https://godbolt.org/z/3MPTsz6Yn > > Apparently this is used to implement constexpr `std::construct_at`, which > needs to call placement `operator new`, but the latter is not `constexpr`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134475/new/ https://reviews.llvm.org/D134475 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits