From 552397a2341e7fc5558461ad006d827a0b3b5ed6 Mon Sep 17 00:00:00 2001 From: k-hara Date: Thu, 20 Nov 2014 11:21:14 +0900 Subject: [PATCH] fix Issue 13757 - [CTFE] extern(C) alias declaration does not work in CTFE --- src/interpret.c | 3 ++- test/compilable/interpret3.d | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/interpret.c b/src/interpret.c index e6d2acb58f70..88a1bec94762 100644 --- a/src/interpret.c +++ b/src/interpret.c @@ -2636,7 +2636,8 @@ class Interpreter : public Visitor { Dsymbol *s = (*ad->decl)[0]; if (s->isAggregateDeclaration() || - s->isTemplateDeclaration()) + s->isTemplateDeclaration() || + s->isAliasDeclaration()) { result = NULL; return; // static (template) struct declaration. Nothing to do. diff --git a/test/compilable/interpret3.d b/test/compilable/interpret3.d index 61666cd5f6c5..70f513235f32 100644 --- a/test/compilable/interpret3.d +++ b/test/compilable/interpret3.d @@ -4829,6 +4829,16 @@ static assert({ return true; }()); +/************************************************** + 13757 extern(C) alias declaration +**************************************************/ + +static assert({ + alias FP1 = extern(C) int function(); + alias extern(C) int function() FP2; + return true; +}()); + /************************************************** 6522 opAssign + foreach ref **************************************************/