D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 16399 - template with func. ptr. argument and anon. func. in the template body, rejects its argument
Summary: template with func. ptr. argument and anon. func. in the template body, rejec...
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-17 14:24 UTC by Cauterite
Modified: 2022-11-10 12:49 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Cauterite 2016-08-17 14:24:32 UTC
( https://dpaste.dzfl.pl/79301f12e5fc )

// ------ Example: ----------

template A(alias Arg) {
	enum A = Arg;
	enum Unrelated = ({return 0;})(); // Error: expression & asdf is not a valid template value argument
};

void main() {
	enum FnPtr = &asdf;
	enum _ = A!FnPtr;
};

void asdf() {};

// ------------------

remove the "enum Unrelated =" line and it compiles fine.
this also compiles fine: https://dpaste.dzfl.pl/fca15065a4cf
Comment 1 RazvanN 2022-11-10 12:49:03 UTC
I cannot reproduce this with the latest version of master.