public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11682] New: ICE in Templates default value call a function
@ 2003-07-27  7:40 boaz at hishome dot net
  2003-07-27 13:23 ` [Bug c++/11682] " pinskia at physics dot uc dot edu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: boaz at hishome dot net @ 2003-07-27  7:40 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: ICE in Templates default value call a function
           Product: gcc
           Version: 3.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: boaz at hishome dot net
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i368-pc-linux
GCC target triplet: i386-pc-linux

-- BELOW is very similar, but not the same, as bug #9436 --

<Code file=main.cpp>

#include <typeinfo>
int get_uuidof( std::type_info& inf ) ;

template< class T ,int i = get__uuidof( typeid(T) ) >
struct TBoaz{
     T m_t ;
     int m_i ;

     TBoaz() : m_i( i ) {}
} ;

struct ABoaz{
ABoaz(){}
};

int main(int argc, char *argv[])
{
  TBoaz<ABoaz> b ;
  return 0;
}

</code>

Invoked as:
c++ -O2 -O0 -g3 -Wall -fno-exceptions -fno-check-new -c main.cpp 
main.cpp:21: internal error: Segmentation fault 
Please submit a full bug report, 
with preprocessed source if appropriate. 


it looks like the use of "typeid" in a default template parameter is somthing
not expected by GCC. 

free life
Boaz


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

* [Bug c++/11682] ICE in Templates default value call a function
  2003-07-27  7:40 [Bug c++/11682] New: ICE in Templates default value call a function boaz at hishome dot net
@ 2003-07-27 13:23 ` pinskia at physics dot uc dot edu
  2003-07-27 16:09 ` boaz at hishome dot net
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-27 13:23 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-27 13:23 -------
On the mainline (20030727), this code is rejected:
pr11682.cc:4: error: could not convert `<expression of type const 
   std::type_info>' to `std::type_info&'
pr11682.cc: In function `int main(int, char**)':
pr11682.cc:18: error: could not convert `*&_ZTI5ABoaz' to `std::type_info&'
pr11682.cc:2: error: in passing argument 1 of `int get_uuidof(std::type_info&)'
pr11682.cc:18: error: template argument 2 is invalid
pr11682.cc:18: error: expected `;'


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

* [Bug c++/11682] ICE in Templates default value call a function
  2003-07-27  7:40 [Bug c++/11682] New: ICE in Templates default value call a function boaz at hishome dot net
  2003-07-27 13:23 ` [Bug c++/11682] " pinskia at physics dot uc dot edu
@ 2003-07-27 16:09 ` boaz at hishome dot net
  2003-07-27 17:05 ` pinskia at physics dot uc dot edu
  2003-07-28 12:47 ` pinskia at physics dot uc dot edu
  3 siblings, 0 replies; 5+ messages in thread
From: boaz at hishome dot net @ 2003-07-27 16:09 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From boaz at hishome dot net  2003-07-27 16:09 -------
Wow grate ... 
my Mandrake gcc 3.2.2 whould ICE so I didn't see that "const" thing.
my Mandrake gcc 3.2.2 still ICE with "const" in place could you please check:

<code> 
int get_uuidof(const std::type_info& inf ) ;
</code>

Just so we can saflly close this bug?
Thanks and please forgive me for not checking with the "mainline"
What should I do now do I need to close the bug?

by the way, off topic, it looks hard to change gcc in Mandrake (no Mandrake
available update yet) do you know of an easy way to compile with a newer GCC
without changing the default one?


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

* [Bug c++/11682] ICE in Templates default value call a function
  2003-07-27  7:40 [Bug c++/11682] New: ICE in Templates default value call a function boaz at hishome dot net
  2003-07-27 13:23 ` [Bug c++/11682] " pinskia at physics dot uc dot edu
  2003-07-27 16:09 ` boaz at hishome dot net
@ 2003-07-27 17:05 ` pinskia at physics dot uc dot edu
  2003-07-28 12:47 ` pinskia at physics dot uc dot edu
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-27 17:05 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-27 17:05 -------
Even after adding const, the mainline rejects the code:
pr11682.cc: In function `int main(int, char**)':
pr11682.cc:18: error: non-constant `get_uuidof(const 
   std::type_info&)((&_ZTI5ABoaz))' cannot be used as template argument
pr11682.cc:18: error: expected `;'

There is a different problem in not demangling the symbol _ZTI5ABoaz.

I think this is right based of the fact the mainline is more compliant to the standard.


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

* [Bug c++/11682] ICE in Templates default value call a function
  2003-07-27  7:40 [Bug c++/11682] New: ICE in Templates default value call a function boaz at hishome dot net
                   ` (2 preceding siblings ...)
  2003-07-27 17:05 ` pinskia at physics dot uc dot edu
@ 2003-07-28 12:47 ` pinskia at physics dot uc dot edu
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-28 12:47 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
           Keywords|                            |ice-on-invalid-code
         Resolution|                            |FIXED


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-28 12:47 -------
Since GCC was ICEing on invalid code and GCC no longers ICE in 3.4 (the mainline) 
and this is not a regression, I am closing this as fixed.  The demangling problem is in bug 
11685.


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

end of thread, other threads:[~2003-07-28 12:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-27  7:40 [Bug c++/11682] New: ICE in Templates default value call a function boaz at hishome dot net
2003-07-27 13:23 ` [Bug c++/11682] " pinskia at physics dot uc dot edu
2003-07-27 16:09 ` boaz at hishome dot net
2003-07-27 17:05 ` pinskia at physics dot uc dot edu
2003-07-28 12:47 ` pinskia at physics dot uc dot edu

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