September 25, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=160

            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: https://bitbucket.org/goshawk/gdc/downloads/GCC-4.8-MinGW-GDC-.7z

D:\workspace\dtest>gdc -v
Using built-in specs.
COLLECT_GCC=gdc
COLLECT_LTO_WRAPPER=d:/gdc/bin/../libexec/gcc/i686-pc-mingw32/4.8.0/lto-wrapper.exe
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
--enable-languages=c,c++,d,lto
Thread model: win32
gcc version 4.8.0 20130303 (experimental) (GCC)

-- 
You are receiving this mail because:
You are watching all bug changes.