clang icon indicating copy to clipboard operation
clang copied to clipboard

Require complete metaclass definitions for class prototypes

Open Jenny-fa opened this issue 7 years ago • 0 comments

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.

Jenny-fa avatar Mar 28 '17 05:03 Jenny-fa