public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57887] New: nested non-type template parameters not declared in this scope
@ 2013-07-12 13:06 plasmahh at gmx dot net
  2013-08-18 13:08 ` [Bug c++/57887] " paolo.carlini at oracle dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: plasmahh at gmx dot net @ 2013-07-12 13:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57887

            Bug ID: 57887
           Summary: nested non-type template parameters not declared in
                    this scope
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: plasmahh at gmx dot net

Hi, when trying to compile the following:

struct B
{
        template<int N>
        struct A
        {
                int X = N;
        };
};

I get the error: 
g.cxx:6:11: error: 'N' was not declared in this scope

Things work fine when I make X a static const(expr), or when I move A outside
B. The above code however works fine within clang, and I could not find any
wording that would make N suddenly not being available within A, especially
since when you add teh following member function to A (but remove X), it
compiles fine:

void foo( ) { int x = N; }

so it /somehow/ is in scope.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-05-11 14:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-12 13:06 [Bug c++/57887] New: nested non-type template parameters not declared in this scope plasmahh at gmx dot net
2013-08-18 13:08 ` [Bug c++/57887] " paolo.carlini at oracle dot com
2013-10-16 22:59 ` paolo.carlini at oracle dot com
2013-10-17 10:56 ` paolo.carlini at oracle dot com
2013-11-14  0:54 ` paolo.carlini at oracle dot com
2013-11-14 20:17 ` paolo at gcc dot gnu.org
2013-11-14 20:18 ` paolo.carlini at oracle dot com
2014-04-02  6:26 ` jaak at ristioja dot ee
2014-04-02  9:30 ` redi at gcc dot gnu.org
2014-05-11 14:15 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).