Possible bug: nvcc and gcc 4.9.3 get into conflict over unnamed type template parameters

Consider the following minimal example:

template<class T, int>
struct A
{
    A() = default;
    A(int) : A() {}
};

int main()
{
    return 0;
}

Compiling with “nvcc -std c+11 -o bug bug.cu” (and, as I am on Arch Linux, ccbin set to a vanilla gcc 4.9.3) returns the following error message:

bug.cu: In constructor ‘A<T, <anonymous> >::A(int)’:
bug.cu:5:18: error: ‘__T0’ was not declared in this scope
     A(int) : A() {}
                  ^
bug.cu:5:22: error: template argument 2 is invalid
     A(int) : A() {}
                      ^
bug.cu:5:24: error: expected ‘{’ before ‘(’ token
     A(int) : A() {}
                        ^

When looking at the preprocessed files nvcc transformed the struct to this:

template< class T, int >
struct A {
A() = default;
A(int) : ::A< T, __T0> () { }
};

__T0 is of course undefined and thus causes an error once gcc takes over.

I am posting this here as I am somehow not allowed to file a bug on the official bug tracker despite being an “approved” developer.

I am using CUDA Toolkit v7.0 and I am on the x86_64 platform.

Are you able to test this with the 7.5RC? This could be fixed already with 7.5 (if it is a bug).

What exactly does this mean? You logged into the CUDA registered developer website, followed the link to the bug reporting form, filled in the form, then submitted it. What happened at that point? What error message did you receive?