Summary: The ASTImporter does currently not handle const_casts. This patch adds the missing const_cast importer code and the test case that discovered this. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50932 llvm-svn: 340182
13 lines
259 B
C++
13 lines
259 B
C++
struct A {
|
|
virtual ~A() {}
|
|
};
|
|
struct B : public A {};
|
|
|
|
void f() {
|
|
const A *b = new B();
|
|
const B *c1 = dynamic_cast<const B *>(b);
|
|
const B *c2 = static_cast<const B *>(b);
|
|
const B *c3 = reinterpret_cast<const B *>(b);
|
|
A *c4 = const_cast<A *>(b);
|
|
}
|