In dmd 1.045, you used to be able to declare structs like this: >> struct FT_RasterRec; << This no longer works with dmd 1.046. The error message is: test.d(1): Error: struct jk.FT_RasterRec has forward references Declaring structs like this is often done in C to define incomplete types, and is especially useful when porting C headers. Also, the new behavior in dmd 1.046 breaks old code.
Patch: Change one line in struct.c line 64. (This makes it the same as the code in D2). --- void AggregateDeclaration::semantic2(Scope *sc) { //printf("AggregateDeclaration::semantic2(%s)\n", toChars()); - if (scope) + if (scope && members) { error("has forward references"); return; }
What bug reports are there already for the fact that we have a "has forward references" error here in the code?
(In reply to comment #2) > What bug reports are there already for the fact that we have a "has forward > references" error here in the code? I don't think there are any. This is a very simple regression, caused by a typo. It's unrelated to other forward reference errors.
(In reply to comment #3) > (In reply to comment #2) > > What bug reports are there already for the fact that we have a "has forward > > references" error here in the code? > > I don't think there are any. This is a very simple regression, caused by a > typo. It's unrelated to other forward reference errors. Maybe, but it's clearly related to at least one other cause of the same forward reference error. If it weren't, then any fix to this bug would cause the line error("has forward references"); to disappear completely. So it's a matter of figuring out what else triggers this error.
Fixed dmd 1.047
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル