rsmith added inline comments.
================
Comment at: clang/lib/AST/ExprConstant.cpp:5615-5627
+ if (canEvalMSConstexpr || isMSConstexpr) {
+ // Diagnose invalid usage of [[msvc::constexpr]] function
+ bool isConstructor = isa<CXXConstructorDecl>(Definition);
+ if (canEvalMSConstexpr) { // !isMSConstexpr
+ Info.FFDiag(CallLoc, diag::note_constexpr_invalid_function, 1)
+ << /*IsConstexpr*/ 0 << isConstructor << Definition;
+ Info.Note(Definition->getLocation(), diag::note_declared_at);
----------------
Given that the intended use case is for usage behind the scenes in the standard
library, I don't think we should be changing our diagnostic output at all here.
If the library, as an implementation detail, marks a non-`constexpr` function
as `[[msvc::constexpr]]`, we shouldn't tell the user to add
`[[msvc::constexpr]]` to their code to allow it to be called, after all, the
annotation is an implementation detail of the MS standard library.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134475/new/
https://reviews.llvm.org/D134475
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits