clang
clang copied to clipboard
Require complete metaclass definitions for class prototypes
Currently, Clang does not prevent nor diagnose this type of recursive declaration, where, within a metaclass definition, a class prototype based on its enclosing metaclass (i.e., a class that is declared using the enclosing metaclass' name as the class-key) is defined.
$class Ifoo {
Ifoo foo { /* ... */ }; // Should be invalid.
}
To resolve this, a check should be performed (perhaps during semantic analysis) that verifies that the referenced metaclass is not currently being defined.