Timm =?utf-8?q?Bäder?= <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>


https://github.com/yronglin commented:

FWIW, I just tried applying your patch to Clang trunk and ran my example:
```cpp
// clang++ -cc1 -std=c++2c -fexperimental-new-constant-interpreter 
-fsyntax-only ./main.cpp
struct V {
  int n = 7;
};
struct D : virtual V {};
constexpr D d{};
consteval const V *f() { return &d; }
constexpr int g() { return f()->n; }
static_assert(g() == 7);

```
But I encountered a crash:
```
clang: /home/yihwang/dev/llvm-project/clang/lib/AST/ByteCode/Record.cpp:54: 
const clang::interp::Record::Base* clang::interp::Record::getBase(const 
clang::RecordDecl*) const: Assertion `It != BaseMap.end() && "Missing base"' 
failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and 
include the crash backtrace and dumped files.
Stack dump:
0.      Program arguments: ./bin/clang -cc1 -std=c++2c 
-fexperimental-new-constant-interpreter -fsyntax-only ./main.cpp
1.      <eof> parser at end of file
 #0 0x00005a981c137e31 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) 
(./bin/clang+0x4702e31)
 #1 0x00005a981c1347ef llvm::sys::RunSignalHandlers() (./bin/clang+0x46ff7ef)
 #2 0x00005a981c13493c SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00005a981c1349fc SignalHandlerTerminate(int, siginfo_t*, void*) 
Signals.cpp:0:0
 #4 0x000070ef28a45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #5 0x000070ef28a9eb2c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #6 0x000070ef28a9eb2c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #7 0x000070ef28a9eb2c pthread_kill ./nptl/pthread_kill.c:89:10
 #8 0x000070ef28a4527e raise ./signal/../sysdeps/posix/raise.c:27:6
 #9 0x000070ef28a288ff abort ./stdlib/abort.c:81:7
#10 0x000070ef28a2881b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#11 0x000070ef28a3b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#12 0x00005a982058b3bf clang::interp::Record::getBase(clang::RecordDecl const*) 
const (./bin/clang+0x8b563bf)
#13 0x00005a98202686ad 
clang::interp::Compiler<clang::interp::ByteCodeEmitter>::visitAPValue(clang::APValue
 const&, clang::interp::PrimType, clang::interp::SourceInfo) 
(./bin/clang+0x88336ad)
#14 0x00005a982026a229 
clang::interp::Compiler<clang::interp::ByteCodeEmitter>::VisitConstantExpr(clang::ConstantExpr
 const*) (./bin/clang+0x8835229)
#15 0x00005a982025fdca 
clang::interp::Compiler<clang::interp::ByteCodeEmitter>::visit(clang::Expr 
const*) (./bin/clang+0x882adca)
#16 0x00005a9820269e82 
clang::interp::Compiler<clang::interp::ByteCodeEmitter>::VisitMemberExpr(clang::MemberExpr
 const*) (./bin/clang+0x8834e82)
```



https://github.com/llvm/llvm-project/pull/204289
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to