-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] @metaclass
prevents type inheriting
#453
Comments
Regarding Regarding |
This is now #779.
With Line 634 in 11fc88d
By the way,
|
Not "polymorphic types", but "implementation inheritance". |
So what I really want is Cpp1's defaults. |
For some more context, I'm writing a shim.
Given that
|
This is actually the only option. |
Instead of
The default constructor uses the data members' initializers, |
This is the documentation for Line 475 in 11fc88d
There's no way to know, nor assert at compile-time, |
I.e., the rule of zero. Using
This happens to work, but is unfortunately mechanic and verbose (https://cpp2.godbolt.org/z/rWfG5cvTz):
|
Fixing #547 as requested would make my uses of |
And this is how it has to look if it's a template of arity 1 (https://cpp2.godbolt.org/z/rYqonvqYP):
|
Having
this: Base
prevents type with some @meta from compilingReproduce Code
https://cpp2.godbolt.org/z/Y5sY4a39G
Version
latest (38aec57)
Command lines
cppfront/cppfront $1.cpp2 -p
clang++-15 -Icppfront/include $1.cpp -std=c++20 -o $1
Expected result
Successful compilation or clearer diagnostic if that's intended
Actual result
@basic_value or @value or @struct:
error: expected 'BaseBV = ...' initialization statement - an operator= body must start with a series of 'member = value;'
@interface:
error: while applying @interface - interfaces may not contain data objects
Additional context
This is specifically about what seems as valid combinations, like
@interface::@interface
I'm not talking about impossible combinations, like
@polymorphic_base::@copyable
, that could be another issue.Which actually compiles, giving cpp1 warning about
The text was updated successfully, but these errors were encountered: