[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 7 02:10:46 PST 2024


================
@@ -7732,7 +7732,8 @@ TreeTransform<Derived>::TransformIfStmt(IfStmt *S) {
     if (Then.isInvalid())
       return StmtError();
   } else {
-    Then = new (getSema().Context) NullStmt(S->getThen()->getBeginLoc());
+    Then = new (getSema().Context)
+        CompoundStmt(S->getThen()->getBeginLoc(), S->getThen()->getEndLoc());
----------------
cor3ntin wrote:

I think this is fine ( I don't see a better solution) but it probably warrants a comment.

https://github.com/llvm/llvm-project/pull/77214


More information about the cfe-commits mailing list