www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Bug 160] New: Support for "Variable Templates" missing/broken

Date: Thu, 25 Sep 2014 21:51:30 +0100
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"


            Bug ID: 160
           Summary: Support for "Variable Templates" missing/broken
           Product: GDC
           Version: 4.8.x
          Hardware: All
                OS: MinGW
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gdc
          Assignee: ibuclaw gdcproject.org
          Reporter: p.remmers arcor.de

Reading the "D Programming Language" CHM Guide from my DMD installation,
I found the chapter about templates, which says:

Variable Templates
Same as aggregates and functions, variable declarations with Initializer can
have optional template parameters: 

enum string constant(TL...) = TL.stringof;
ubyte[T.sizeof] storage(T) = 0;
auto array(alias a) = a;

These declarations are transformed into templates: 

template constant(TL...) {
  enum string constant = TL.stringof;
template storage(T) {
  ubyte[T.sizeof] storage = 0;
template array(alias a) {
  auto array = a;

When I tried the short forms of these examples with GDC, I got a bunch of
errors (semicolon expected following function declaration). Basically, GDC does
not recognize them as variable templates. Checking with DMD resulted in no
error messages.

I'm on Windows, using this package:

D:\workspace\dtest>gdc -v
Using built-in specs.
Target: i686-pc-mingw32
Configured with: ../configure --prefix=/crossdev/gdc/install
--with-gmp=/crossdev/gdc/deps/gmp --with-mpfr=/crossdev/gdc/deps/mpfr
--with-mpc=/crossdev/gdc/deps/mpc --with-cloog=/crossdev/gdc/deps/cloog/
--with-isl=/crossdev/gdc/deps/isl --disable-bootstrap
Thread model: win32
gcc version 4.8.0 20130303 (experimental) (GCC)

You are receiving this mail because:
You are watching all bug changes.
Sep 25 2014