Skip to content

Commit 1d0e8b2

Browse files
committed
[clang][Interp] Remove a no longer needed dummy check
Since we now have type info for dummy pointers, we don't need this check anymore and can also have the same output for the test case in records.cpp.
1 parent b646876 commit 1d0e8b2

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

clang/lib/AST/Interp/Interp.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,9 +1371,6 @@ inline bool GetPtrVirtBasePop(InterpState &S, CodePtr OpPC,
13711371
const Pointer &Ptr = S.Stk.pop<Pointer>();
13721372
if (!CheckNull(S, OpPC, Ptr, CSK_Base))
13731373
return false;
1374-
if (Ptr.isDummy()) // FIXME: Once we have type info for dummy pointers, this
1375-
// needs to go.
1376-
return false;
13771374
return VirtBaseHelper(S, OpPC, D, Ptr);
13781375
}
13791376

clang/test/AST/Interp/records.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,8 +1335,6 @@ namespace UnnamedBitFields {
13351335
static_assert(a.c == 'a', "");
13361336
}
13371337

1338-
/// FIXME: This still doesn't work in the new interpreter because
1339-
/// we lack type information for dummy pointers.
13401338
namespace VirtualBases {
13411339
/// This used to crash.
13421340
namespace One {
@@ -1346,15 +1344,15 @@ namespace VirtualBases {
13461344
};
13471345
class B : public virtual A {
13481346
public:
1349-
int getX() { return x; } // ref-note {{declared here}}
1347+
int getX() { return x; } // both-note {{declared here}}
13501348
};
13511349

13521350
class DV : virtual public B{};
13531351

13541352
void foo() {
13551353
DV b;
13561354
int a[b.getX()]; // both-warning {{variable length arrays}} \
1357-
// ref-note {{non-constexpr function 'getX' cannot be used}}
1355+
// both-note {{non-constexpr function 'getX' cannot be used}}
13581356
}
13591357
}
13601358

0 commit comments

Comments
 (0)