c++/734: namespace AND template AND struct AND virtual together cause internal compiler error
rezarob@direct.ca
rezarob@direct.ca
Fri Nov 3 19:06:00 GMT 2000
>Number: 734
>Category: c++
>Synopsis: namespace AND template AND struct AND virtual together cause internal compiler error
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Fri Nov 03 19:06:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Reza Roboubi
>Release: gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
>Organization:
>Environment:
RedHat Linux 6.2
intel x386 (K6II)
>Description:
cd /var/tmp/
g++ -g -c WordIndex.C
WordIndex.C: In method `int ::LongVirtualMemory::::LongVirtualMemory::LinearMem<int>::LinearMem_<int>()':
WordIndex.C:20: instantiated from here
WordIndex.C:14: Internal compiler error.
WordIndex.C:14: Please submit a full bug report to `egcs-bugs@egcs.cygnus.com'.
WordIndex.C:14: See <URL: http://egcs.cygnus.com/faq.html#bugreport > for details.
Compilation exited abnormally with code 1 at Fri Nov 3 18:50:05
>How-To-Repeat:
//this is the source
//use g++ -g -c WordIndex.C
namespace LongVirtualMemory {
template <class size_t>
class LinearMem
{
struct BlockHead
{
size_t size;
};
typedef int ii;
ii ReadBlockHead();
virtual readDev(){};
public:
LinearMem_(){readDev();}
};
mmm()
{
LinearMem<int> ll;
ll.LinearMem_();
}
}
>Fix:
take out 'namespace' or 'virtual' or 'struct.'
Any one will force error free compilation.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="WordIndex.C"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="WordIndex.C"
bmFtZXNwYWNlIExvbmdWaXJ0dWFsTWVtb3J5IHsKCiAgdGVtcGxhdGUgPGNsYXNzIHNpemVfdD4K
ICBjbGFzcyBMaW5lYXJNZW0KICB7CiAgICBzdHJ1Y3QgQmxvY2tIZWFkCiAgICB7CiAgICAgIHNp
emVfdCBzaXplOwogICAgfTsKICAgIHR5cGVkZWYgaW50IGlpOwogICAgaWkgUmVhZEJsb2NrSGVh
ZCgpOwogICAgdmlydHVhbCByZWFkRGV2KCl7fTsKICBwdWJsaWM6CiAgICBMaW5lYXJNZW1fKCl7
cmVhZERldigpO30KICB9OwoKICBtbW0oKQogIHsKICAgIExpbmVhck1lbTxpbnQ+IGxsOwogICAg
bGwuTGluZWFyTWVtXygpOwogIH0KfQo=
More information about the Gcc-bugs
mailing list