Skip to content

Instantly share code, notes, and snippets.

@beholdnec
Created September 17, 2021 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beholdnec/6a7ae8a1b7da73d2367bc3ec427dbfa2 to your computer and use it in GitHub Desktop.
Save beholdnec/6a7ae8a1b7da73d2367bc3ec427dbfa2 to your computer and use it in GitHub Desktop.
test2.cpp for llvm-mos issue
#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