Skip to content
This repository has been archived by the owner on Jun 20, 2019. It is now read-only.

Commit

Permalink
Bug 108: ICE using @Attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Mar 16, 2014
1 parent d49d20a commit b38af3d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gcc/d/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2014-03-16 Iain Buclaw <ibuclaw@gdcproject.org>

* d-codegen.cc(build_attributes): Ensure D-specific attributes have
their value interpreted through CTFE.

2014-02-21 Iain Buclaw <ibuclaw@gdcproject.org>

* d-codegen.cc(d_build_module): Update signature to accept a Loc
Expand Down
3 changes: 3 additions & 0 deletions gcc/d/d-codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,9 @@ build_attributes (Expressions *in_attrs)
&& !mod->parent->parent))
continue;

if (attr->op == TOKcall)
attr = attr->ctfeInterpret();

gcc_assert(attr->op == TOKstructliteral);
Expressions *elem = ((StructLiteralExp*) attr)->elements;

Expand Down
19 changes: 19 additions & 0 deletions gcc/testsuite/gdc.test/compilable/gdc.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import gcc.attribute;

/* Test all gdc supported attributes. */

@attribute("forceinline")
void forceinline()
{
}

@attribute("noinline")
void noinline()
{
}

@attribute("flatten")
void flatten()
{
}

0 comments on commit b38af3d

Please sign in to comment.