Skip to content

Commit

Permalink
Revert "[clang][Interp] Improve "in call to" call argument printing (#…
Browse files Browse the repository at this point in the history
…102735)"

This reverts commit 979abf1.
  • Loading branch information
vitalybuka committed Aug 11, 2024
1 parent 3c3df1b commit 7e8bb8c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
5 changes: 2 additions & 3 deletions clang/lib/AST/Interp/InterpFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ void InterpFrame::popArgs() {
}

template <typename T>
static void print(llvm::raw_ostream &OS, const T &V, ASTContext &ASTCtx,
QualType Ty) {
V.toAPValue(ASTCtx).printPretty(OS, ASTCtx, Ty);
static void print(llvm::raw_ostream &OS, const T &V, ASTContext &, QualType) {
OS << V;
}

template <>
Expand Down
15 changes: 0 additions & 15 deletions clang/test/AST/Interp/constexpr-frame-describe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,3 @@ static_assert(bar.fail2<int*, 42>()); // both-error {{constant expression}} \
static_assert(bar.fail3(3, 4UL, bar, &bar)); // both-error {{constant expression}} \
// expected-note {{in call to 'bar.fail3<int, unsigned long, Bar<int>, const Bar<int> *>(3, 4, &bar, &bar)'}} \
// ref-note {{in call to 'bar.fail3<int, unsigned long, Bar<int>, const Bar<int> *>(3, 4, {}, &bar)'}}



/// FIXME: Bound member pointer printing doesn't work right, see the last parameter to MemPtr().
struct MemPtrTest {
int n;
void f();
};
MemPtrTest mpt; // both-note {{here}}
constexpr int MemPtr(int (MemPtrTest::*a), void (MemPtrTest::*b)(), int &c) {
return c; // both-note {{read of non-constexpr variable 'mpt'}}
}
static_assert(MemPtr(&MemPtrTest::n, &MemPtrTest::f, mpt.*&MemPtrTest::n), ""); // both-error {{constant expression}} \
// expected-note {{in call to 'MemPtr(&MemPtrTest::n, &MemPtrTest::f, mpt)'}} \
// ref-note {{in call to 'MemPtr(&MemPtrTest::n, &MemPtrTest::f, mpt.n)'}}

0 comments on commit 7e8bb8c

Please sign in to comment.