http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49192
Summary: Misleading error message about unknown discriminant Product: gcc Version: 4.4.5 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: ada AssignedTo: unassig...@gcc.gnu.org ReportedBy: yannick_duch...@yahoo.fr Created attachment 24371 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24371 Example file which produce the erroneous error message Summary: a package defines a type T with an unknown discriminant; if you instantiate an entity of that type, giving it (by inadvertence) a discriminant, then GNATMake will complain “invalid constraint: type has no discriminant”. This message is misleading and confusing for beginners, as the type actual has a discriminated view. The Ada compiler should instead complain the discriminant is unknown, and so any discriminant would fail. Why not: “type discriminant is unknown, any is invalid” ? See attached file a a short source file which reproduce this tiny bug.