Skip to content

Commit 56b63e0

Browse files
committed
[clang][Interp] Get <=> value info from weak result
This is also what the current interpreter does and a couple of test cases expect that.
1 parent e510fc7 commit 56b63e0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

clang/lib/AST/Interp/Interp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,8 @@ bool CMP3(InterpState &S, CodePtr OpPC, const ComparisonCategoryInfo *CmpInfo) {
808808
}
809809

810810
assert(CmpInfo);
811-
const auto *CmpValueInfo = CmpInfo->getValueInfo(CmpResult);
811+
const auto *CmpValueInfo =
812+
CmpInfo->getValueInfo(CmpInfo->makeWeakResult(CmpResult));
812813
assert(CmpValueInfo);
813814
assert(CmpValueInfo->hasValidIntValue());
814815
const APSInt &IntValue = CmpValueInfo->getIntValue();

clang/test/SemaCXX/compare-modules-cxx2a.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// RUN: mkdir -p %t
33

44
// RUN: %clang_cc1 -triple x86_64-apple-darwin -fcxx-exceptions -verify -std=c++2a -fmodules -fmodules-cache-path=%t.mcp -I%S/Inputs %s -fno-modules-error-recovery -fmodule-map-file=%S/Inputs/compare.modulemap
5+
// RUN: %clang_cc1 -triple x86_64-apple-darwin -fcxx-exceptions -verify -std=c++2a -fmodules -fmodules-cache-path=%t.mcp -I%S/Inputs %s -fno-modules-error-recovery -fmodule-map-file=%S/Inputs/compare.modulemap -fexperimental-new-constant-interpreter
56

67
struct CC { CC(...); };
78

0 commit comments

Comments
 (0)