Created
September 17, 2021 23:50
-
-
Save beholdnec/6a7ae8a1b7da73d2367bc3ec427dbfa2 to your computer and use it in GitHub Desktop.
test2.cpp for llvm-mos issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
class Base { | |
public: | |
virtual ~Base() { } | |
virtual void fn() = 0; | |
}; | |
class SubA : public Base { | |
public: | |
void fn() override { } | |
}; | |
class SubB : public Base { | |
public: | |
void fn() override { } | |
}; | |
static void indCall(Base* b) { | |
b->fn(); | |
} | |
void testIndCall(char sel) { | |
Base* b; | |
if (sel) { | |
b = new SubA(); | |
} else { | |
b = new SubB(); | |
} | |
b->fn(); | |
delete b; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment