erichkeane added inline comments.
================ Comment at: clang/unittests/Interpreter/InterpreterTest.cpp:237-240 + std::string MangledName = MangleName(TmpltSpec); + typedef int (*TemplateSpecFn)(void *); + auto fn = (TemplateSpecFn)cantFail(Interp->getSymbolAddress(MangledName)); + EXPECT_EQ(42, fn(NewA)); ---------------- aaron.ballman wrote: > This test is broken for some of our internal build bots at Intel. I think > something suspicious is going on here, but I'm not certain of the intent > behind the test, so I'm not certain the best way to fix it. The behavior of > the test is that on an x86 Windows machine, sometimes this particular test > fails: > ``` > [ RUN ] IncrementalProcessing.InstantiateTemplate^M > unknown file: error: SEH exception with code 0x3221225477 thrown in the test > body.^M > [ FAILED ] IncrementalProcessing.InstantiateTemplate (35 ms)^M > ``` > but it's not a consistent failure (seems to happen about one out of every > three runs). > > `callme` is a templated member function of `B` but here we're trying to call > it like it's a free function. That's... not good. We could either make > `callme` a `static` member function so that it can be called in this manner, > or we could try to come up with a magic incantation to call it as a PMF. > > Can you investigate, @v.g.vassilev? If it is going to take considerable time > to resolve, it might be worth reverting temporarily. Thanks! To be perhaps succinct, the problem is calling Pointer-to-member-function as a free-function. The cast on line 239 is completely invalid, and can't be done in C++ code itself without UB. We believe this shows up on x86 in particular since there is ALSO a calling-convention mismatch here, but this cast to TemplateSpecFn seems completely invalid to me. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112663/new/ https://reviews.llvm.org/D112663 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits