The text says "already-defined", but in the first case it's merely declared twice.

If there's really no better justification than "because the standard says so", why not make this Ext or ExtWarn instead of Error? Clearly we already have this working.

Jordan


On Jun 9, 2013, at 23:51 , David Majnemer <[email protected]> wrote:

The attached patch implements DR85 [*] which disallows the existence of a declaration of a member class that isn't a forward declaration before it's definition.

This means that the following would be disallowed:
class A {
  struct B; // note here
  struct B; // error here
};

as well as:
class C {
  struct B {}; // note here
  struct B; // error here
};

I'm very open to suggestions on the diagnostic, I couldn't think of a great one that doesn't boil down to "this is forbidden because the standard says so."

Attachment: dr85.diff
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to