Bug 59809 - template non-type parameter in nested class-template said not be declared
Summary: template non-type parameter in nested class-template said not be declared
Status: RESOLVED DUPLICATE of bug 57887
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.7.2
: P3 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-14 16:00 UTC by Joren Heit
Modified: 2014-05-11 14:15 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joren Heit 2014-01-14 16:00:14 UTC
The following code results in a compiler error on GCC 4.7.2:

gccbug.cc:8:15: error: ‘V’ was not declared in this scope

Code:

// -----------------------
// gccbug.cc
template <typename T>
struct S
{
    template <int V>
    struct Inner
    {
        int a{V};
    };
};
// -----------------------

Output of gcc -v:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5) 

Command that triggers the error:
g++ --std=c++11 -c gccbug.cc

This might be related to bug 57239.
Comment 1 Paolo Carlini 2014-05-11 14:15:55 UTC
Dup.

*** This bug has been marked as a duplicate of bug 57887 ***