[cfe-dev] clang++ assertion

Andreas Rechberger andreas.rechberger at hotmail.com
Wed Aug 7 06:50:11 PDT 2013


Hi All,

Running
clang++ -c -std=c++11 test.cpp
will cause a debug assertion.

Assertion failed: isa<X>(Val) && "cast_or_null<Ty>() argument of 
incompatible type!", file 
E:\Andreas\PhD\Code\llvm\include\llvm/Support/Casting.h, line 250
clang++.exe: error: clang frontend command failed with exit code 3 (use 
-v to see invocation)

g++ reply to the code would be something like:
test.cpp: In constructor 'Test::Test()':
test.cpp:7:48: error: no matching function for call to 
'std::function<void()>::function(void (Test::*)())'
          std::function <void(void) > x(&Test::Me);
...

The clang/llvm version I used is r187356.
(Windows, Visual Studio 10.0)
Unfortunately my current hardware-setup does not allow me to run a test 
against the most recent trunk.
I can offer to file a bug, or run this case against the most recent 
trunk in my next update cycle (probably in 2 weeks ...),
unless someone is kind enough to run a short trial on a more recent 
version than mine.

/Andreas

______________________________ test.cpp
#include <functional>

class Test {
public:
     Test()
     {
         std::function <void(void) > x(&Test::Me);
     }
     void Me()
     {}
};
______________________________ test.cpp





More information about the cfe-dev mailing list