[clang] [clang][Interp] Fix value truncation when casting int128 to smaller size (PR #67961)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 2 07:07:16 PDT 2023


Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm/llvm-project/pull/67961/clang at github.com>


================
@@ -249,6 +248,11 @@ template <bool Signed> class IntegralAP final {
     R->V = A.V - B.V;
     return false; // Success!
   }
+
----------------
erichkeane wrote:

Is this template forward declared?  Either way, I think as none of the calls are dependent, this ends up being UB (As the lookup 'changes' between the declaration and the call).

All that to say: I think you just have to move this definition above its uses.

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


More information about the cfe-commits mailing list