public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60842] New: In-class initializer causes a strange error
@ 2014-04-14 17:35 kariya_mitsuru at hotmail dot com
  2014-04-14 19:01 ` [Bug c++/60842] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: kariya_mitsuru at hotmail dot com @ 2014-04-14 17:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60842
           Summary: In-class initializer causes a strange error
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kariya_mitsuru at hotmail dot com

The sample code below causes a strange error.

=========================== source code ===========================
namespace N {
    class I {};
}

template <typename, typename>
class J {};

class S {
    J<int, N::I> j = J<int, N::I>{};
};

int main() {}
=========================== source code ===========================

========================== error messages ==========================
prog.cc:9:32: error: invalid use of '::'
     J<int, N::I> j = J<int, N::I>{};
                                ^
prog.cc:9:32: error: expected ';' at end of member declaration
prog.cc:9:33: error: expected unqualified-id before '>' token
     J<int, N::I> j = J<int, N::I>{};
                                 ^
prog.cc:9:24: error: wrong number of template arguments (1, should be 2)
     J<int, N::I> j = J<int, N::I>{};
                        ^
prog.cc:6:7: error: provided for 'template<class, class> class J'
 class J {};
       ^
========================== error messages ==========================

I think that the sample code should be compiled successfully.

cf. http://melpon.org/wandbox/permlink/h96WGv3EW3DOyHnB


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

end of thread, other threads:[~2015-07-10 14:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-14 17:35 [Bug c++/60842] New: In-class initializer causes a strange error kariya_mitsuru at hotmail dot com
2014-04-14 19:01 ` [Bug c++/60842] " redi at gcc dot gnu.org
2014-04-14 19:02 ` redi at gcc dot gnu.org
2014-12-14 15:39 ` ville.voutilainen at gmail dot com
2015-07-10 14:35 ` paolo.carlini at oracle dot com
2015-07-10 14:45 ` paolo.carlini at oracle dot com
2015-07-10 14:45 ` paolo at gcc dot gnu.org

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).