lock3 / meta

122 stars 11 forks source link

compire.require breaks metaclasses instead of display the user provided error message for declaration clones #260

Closed DarkArc closed 4 years ago

DarkArc commented 4 years ago

A reproducible example can be found here: https://cppx.godbolt.org/z/zYzWq8

``` #include #include using namespace std::experimental; //==================================================================== // Library code: implementing the metaclass (once) consteval void value(meta::info source) { for (meta::info mem : meta::member_range(source)) { if (meta::is_member_function(mem)) { meta::compiler.require(!meta::is_virtual(mem), "a value type may not have virtual functions"); } -> mem; } } class(value) Point { virtual int foo() { return 0; } int x; }; // Compiler Explorer note: Click the "triangle ! icon" to see the output: consteval { meta::compiler.print(reflexpr(Point)); } ```
DarkArc commented 4 years ago

Fixed by e71f5467e7082d676d8c146d3f2f11bb08cfc823