Skip to content

Commit

Permalink
[clang][Interp] Get <=> value info from weak result
Browse files Browse the repository at this point in the history
This is also what the current interpreter does and a couple of
test cases expect that.
  • Loading branch information
tbaederr committed Feb 26, 2024
1 parent e510fc7 commit 56b63e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clang/lib/AST/Interp/Interp.h
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,8 @@ bool CMP3(InterpState &S, CodePtr OpPC, const ComparisonCategoryInfo *CmpInfo) {
}

assert(CmpInfo);
const auto *CmpValueInfo = CmpInfo->getValueInfo(CmpResult);
const auto *CmpValueInfo =
CmpInfo->getValueInfo(CmpInfo->makeWeakResult(CmpResult));
assert(CmpValueInfo);
assert(CmpValueInfo->hasValidIntValue());
const APSInt &IntValue = CmpValueInfo->getIntValue();
Expand Down
1 change: 1 addition & 0 deletions clang/test/SemaCXX/compare-modules-cxx2a.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RUN: mkdir -p %t

// 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
// 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

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

Expand Down

0 comments on commit 56b63e0

Please sign in to comment.