public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/31584]  New: ICE on probably invalid code
@ 2007-04-15 20:15 numerical dot simulation at web dot de
  2007-04-16  6:43 ` [Bug c++/31584] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: numerical dot simulation at web dot de @ 2007-04-15 20:15 UTC (permalink / raw)
  To: gcc-bugs

Hi!

The following code snippet leads to an ICE, but I am not sure
whether the stuff I am trying to do is valid.
Any pointer to info about that also appreciated.

Target: i586-suse-linux
Configured with: ../configure --enable-threads=posix --prefix=/usr
--with-local-prefix=/usr/local --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.2
--enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib
--with-system-zlib --enable-shared --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --program-suffix=-4.1
--enable-version-specific-runtime-libs --without-system-libunwind
--with-cpu=generic --host=i586-suse-linux
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (SUSE Linux)



enum Outer { a, b };

template <class T>
class C
{
public:
  enum Inner { c, d };
  template<Inner I, int dummy> struct Dispatcher;

  template<int dummy> struct Dispatcher<c, dummy> 
  {
    static const Outer Show = a;
  };

  template<int dummy> struct Dispatcher<d, dummy> 
  {
    static const Outer Show = b;
  };

public:
  template <Inner I> void DoSomething(int j)
  {
    typedef Dispatcher<I, 1> dispatcher_t;
    static const Outer o = dispatcher_t::Show;
  }
};


int main()
{
  C<double> Test;
  Test.DoSomething<C<double>::c>(1);
}


-- 
           Summary: ICE on probably invalid code
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: numerical dot simulation at web dot de
  GCC host triplet: i586-suse-linux


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


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

* [Bug c++/31584] ICE on probably invalid code
  2007-04-15 20:15 [Bug c++/31584] New: ICE on probably invalid code numerical dot simulation at web dot de
@ 2007-04-16  6:43 ` pinskia at gcc dot gnu dot org
  2007-04-16  9:31 ` numerical dot simulation at web dot de
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-04-16  6:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-04-16 07:43 -------
The trunk gives:
t.cc: In member function 'void C<T>::DoSomething(int) [with C<T>::Inner I = c,
T = double]':
t.cc:32:   instantiated from here
t.cc:24: error: incomplete type 'C<double>::Dispatcher<c, 1>' used in nested
name specifier


Which seems likes the correct error message.


-- 


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


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

* [Bug c++/31584] ICE on probably invalid code
  2007-04-15 20:15 [Bug c++/31584] New: ICE on probably invalid code numerical dot simulation at web dot de
  2007-04-16  6:43 ` [Bug c++/31584] " pinskia at gcc dot gnu dot org
@ 2007-04-16  9:31 ` numerical dot simulation at web dot de
  2007-04-18  6:51 ` numerical dot simulation at web dot de
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: numerical dot simulation at web dot de @ 2007-04-16  9:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from numerical dot simulation at web dot de  2007-04-16 10:31 -------
The compiler at 
http://www.comeaucomputing.com/tryitout/
has absolutely no problems with the code.

M$-VC8 says:
error C2754: 'C<T>::Dispatcher<c,dummy>' : a partial specialization cannot have
a dependent non-type template parameter
which somehow is an error message that clearly states what might be wrong.
The "incomplete type" statement is somehow misleading - IMHO

Could you change the error message in this case?

Of course I disagree with gcc and VC8 here.
Any pointer to a TR on this subject?

Best Regards,

Markus


-- 


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


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

* [Bug c++/31584] ICE on probably invalid code
  2007-04-15 20:15 [Bug c++/31584] New: ICE on probably invalid code numerical dot simulation at web dot de
  2007-04-16  6:43 ` [Bug c++/31584] " pinskia at gcc dot gnu dot org
  2007-04-16  9:31 ` numerical dot simulation at web dot de
@ 2007-04-18  6:51 ` numerical dot simulation at web dot de
  2007-04-23 16:25 ` numerical dot simulation at web dot de
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: numerical dot simulation at web dot de @ 2007-04-18  6:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from numerical dot simulation at web dot de  2007-04-18 07:51 -------
I started a discussion about this code on
comp.lang.c++.moderated, subject  
"enum in template memfun in class template - valid C++?" 
see
<http://groups.google.com/groups/profile?enc_user=IUBmLhUAAACyipKMT4DNptGfylSI-1gK9h3i3SmjGmAJbX05nZ-8fQ>

Your turn.

Markus  


-- 


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


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

* [Bug c++/31584] ICE on probably invalid code
  2007-04-15 20:15 [Bug c++/31584] New: ICE on probably invalid code numerical dot simulation at web dot de
                   ` (2 preceding siblings ...)
  2007-04-18  6:51 ` numerical dot simulation at web dot de
@ 2007-04-23 16:25 ` numerical dot simulation at web dot de
  2010-04-28 18:47 ` redi at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: numerical dot simulation at web dot de @ 2007-04-23 16:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from numerical dot simulation at web dot de  2007-04-23 17:24 -------
Sorry, the link was wrong, must be
http://groups.google.de/group/comp.lang.c++.moderated/browse_thread/thread/8c3b8a84ed78b003/4d9603171894a75d?hl=de#4d9603171894a75d


-- 


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


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

* [Bug c++/31584] ICE on probably invalid code
  2007-04-15 20:15 [Bug c++/31584] New: ICE on probably invalid code numerical dot simulation at web dot de
                   ` (3 preceding siblings ...)
  2007-04-23 16:25 ` numerical dot simulation at web dot de
@ 2010-04-28 18:47 ` redi at gcc dot gnu dot org
  2010-05-03 12:53 ` numerical dot simulation at web dot de
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-04-28 18:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from redi at gcc dot gnu dot org  2010-04-28 18:47 -------
compiles without error using 4.4.3 or 4.6.0


-- 

redi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug c++/31584] ICE on probably invalid code
  2007-04-15 20:15 [Bug c++/31584] New: ICE on probably invalid code numerical dot simulation at web dot de
                   ` (4 preceding siblings ...)
  2010-04-28 18:47 ` redi at gcc dot gnu dot org
@ 2010-05-03 12:53 ` numerical dot simulation at web dot de
  2010-05-03 13:02 ` [Bug c++/31584] [DR502] " redi at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: numerical dot simulation at web dot de @ 2010-05-03 12:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from numerical dot simulation at web dot de  2010-05-03 12:53 -------
Hi!

Though I love the fact that this code now compiles, I am still unsure whether
this is the right thing to have.
>From http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#502 I see that 
the proposed resolution (February, 2010) stands against what David Vandevoorde
said in
http://groups.google.de/group/comp.lang.c++.moderated/browse_thread/thread/8c3b8a84ed78b003/4d9603171894a75d?hl=de#4d9603171894a75d
and the enum now is dependent and so IMHO the code should not compile.
Maybe I missed something. Could you please shed some more light on this?

Markus Werle


-- 

numerical dot simulation at web dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|FIXED                       |


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


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

* [Bug c++/31584] [DR502] ICE on probably invalid code
  2007-04-15 20:15 [Bug c++/31584] New: ICE on probably invalid code numerical dot simulation at web dot de
                   ` (6 preceding siblings ...)
  2010-05-03 13:02 ` [Bug c++/31584] [DR502] " redi at gcc dot gnu dot org
@ 2010-05-03 13:02 ` redi at gcc dot gnu dot org
  2010-09-15  9:04 ` numerical dot simulation at web dot de
  8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-05-03 13:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from redi at gcc dot gnu dot org  2010-05-03 13:02 -------
... and suspend until the issue is ready


-- 

redi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |SUSPENDED


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


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

* [Bug c++/31584] [DR502] ICE on probably invalid code
  2007-04-15 20:15 [Bug c++/31584] New: ICE on probably invalid code numerical dot simulation at web dot de
                   ` (5 preceding siblings ...)
  2010-05-03 12:53 ` numerical dot simulation at web dot de
@ 2010-05-03 13:02 ` redi at gcc dot gnu dot org
  2010-05-03 13:02 ` redi at gcc dot gnu dot org
  2010-09-15  9:04 ` numerical dot simulation at web dot de
  8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-05-03 13:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from redi at gcc dot gnu dot org  2010-05-03 13:01 -------
I didn't realise there was a DR about this, confirm ...


-- 

redi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-05-03 13:01:44
               date|                            |
            Summary|ICE on probably invalid code|[DR502] ICE on probably
                   |                            |invalid code


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


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

* [Bug c++/31584] [DR502] ICE on probably invalid code
  2007-04-15 20:15 [Bug c++/31584] New: ICE on probably invalid code numerical dot simulation at web dot de
                   ` (7 preceding siblings ...)
  2010-05-03 13:02 ` redi at gcc dot gnu dot org
@ 2010-09-15  9:04 ` numerical dot simulation at web dot de
  8 siblings, 0 replies; 10+ messages in thread
From: numerical dot simulation at web dot de @ 2010-09-15  9:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from numerical dot simulation at web dot de  2010-09-15 09:03 -------
Hi!

Looks like http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#502
now has a resolution, namely that a type is dependent if it is
a nested class or enumeration that is a member of the current instantiation.
So though the voting might not be through, the compilers could already adopt
the proposed behavior and give some informational error message.

-> Change Status back to new?

Markus


-- 

numerical dot simulation at web dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |numerical dot simulation at
                   |                            |web dot de


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


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

end of thread, other threads:[~2010-09-15  9:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-15 20:15 [Bug c++/31584] New: ICE on probably invalid code numerical dot simulation at web dot de
2007-04-16  6:43 ` [Bug c++/31584] " pinskia at gcc dot gnu dot org
2007-04-16  9:31 ` numerical dot simulation at web dot de
2007-04-18  6:51 ` numerical dot simulation at web dot de
2007-04-23 16:25 ` numerical dot simulation at web dot de
2010-04-28 18:47 ` redi at gcc dot gnu dot org
2010-05-03 12:53 ` numerical dot simulation at web dot de
2010-05-03 13:02 ` [Bug c++/31584] [DR502] " redi at gcc dot gnu dot org
2010-05-03 13:02 ` redi at gcc dot gnu dot org
2010-09-15  9:04 ` numerical dot simulation at web dot de

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