This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11211] New: trivial static initializers of const objects should be done at compile time
- From: "pinskia at physics dot uc dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jun 2003 16:43:01 -0000
- Subject: [Bug c++/11211] New: trivial static initializers of const objects should be done at compile time
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11211
Summary: trivial static initializers of const objects should be
done at compile time
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Keywords: pessimizes-code
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: pinskia@physics.uc.edu
CC: eric-gcc@omnifarious.org,gcc-bugs@gcc.gnu.org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
Compile this code and see that __static_initialization_and_destruction_0 exists and but it should
produce static initializers:
class Fred {
public:
Fred(int x) : x_(x) { }
private:
int x_;
};
class Barney : public Fred {
public:
Barney(int x, int y) : Fred(x), y_(y) { }
private:
int y_;
};
extern const Barney abarney(5, 6);
extern const Fred afred(2);