Fix names of inherited members being prefixed with the base-class's name when using clang

This commit is contained in:
Heiko Lewin
2024-04-08 10:42:42 +02:00
parent bf20fa6b57
commit 0b33c92c9b
5 changed files with 37 additions and 2 deletions
+26
View File
@@ -0,0 +1,26 @@
#include <cassert>
#include <iostream>
#include <rfl.hpp>
#include <source_location>
namespace test_inheritance {
void test() {
std::cout << std::source_location::current().function_name() << std::endl;
struct S {
int x;
};
struct T : S {};
const auto name = get<0>(rfl::fields<T>()).name();
if (name == "x") {
std::cout << "OK" << std::endl;
} else {
std::cout << "FAIL\n"
<< "Expected member name 'x', got '" << name << "'" << std::endl;
}
}
} // namespace test_inheritance