D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2815 - Attributes at end of file accepted
Summary: Attributes at end of file accepted
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 trivial
Assignee: Walter Bright
URL:
Keywords: accepts-invalid, patch
Depends on:
Blocks:
 
Reported: 2009-04-07 02:04 UTC by Don
Modified: 2014-04-18 09:12 UTC (History)
0 users

See Also:


Attachments
fix 2815 (389 bytes, patch)
2009-04-07 02:06 UTC, Don
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Don 2009-04-07 02:04:06 UTC
A file consisting only of the line:
---
public static nothrow pure extern
---
compiles without error. This patch (for D2.027) makes it an error.
(It remains OK to end with a colon).
Comment 1 Don 2009-04-07 02:06:12 UTC
Created attachment 316 [details]
fix 2815

Adds:

	case TOKeof:
	    error("declaration expected following attribute, not EOF");
    	    break;

to Parser::parseBlock() in parse.c, by analogy to the behaviour for semicolon.
Comment 2 Walter Bright 2009-10-14 02:02:37 UTC
This appears to already be fixed.