Bug 149492
Summary: | g++ seg fault for sizeof(std::vector) | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Robert M. Day <dayrm> |
Component: | gcc3 | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED ERRATA | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3.0 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i686 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2005-05-18 13:42:38 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Robert M. Day
2005-02-23 17:03:21 UTC
That testcase is invalid, std::vector is a template, so you need to supply template arguments for it. You want something like this: #include <iostream> #include <vector> int main () { std::cout << sizeof(std::vector<int>) << std::endl; } G++ 3.4.x and GCC HEAD correctly diagnose this as an error: g++ -o /tmp/149492{,.C} /tmp/149492.C: In function `int main()': /tmp/149492.C:6: error: missing template arguments before ')' token 3.3.x issues diagnostic instead of segfaulting too, so I'll look into fixing this. This was apparently fixed by PR c++/10558 fix on gcc-3_3-branch and a backported fix for that seems to fix it on gcc-3_2-rhl8-branch as well. Will test some more and probably include in RHEL3 U5. Thanks for the quick response and the explanation. Should be fixed in gcc-c++-3.2.3-52. An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2005-258.html |