[Bug libstdc++/19544] Difference in behaviour if default constructor added

gdr at integrable-solutions dot net gcc-bugzilla@gcc.gnu.org
Thu Jan 20 19:42:00 GMT 2005


------- Additional Comments From gdr at integrable-solutions dot net  2005-01-20 19:42 -------
Subject: Re:  Difference in behaviour if default constructor added

"chris at bubblescope dot net" <gcc-bugzilla@gcc.gnu.org> writes:

| I'm still curious as to why the error doesn't appear if let g++ generate a
| default constructor, as from my reading of 12.1/7, the default generated
| constructor should be "ptr() {}", so the error should still appear. Am I reading
| it wrong?

The syntax "ptr()" invokes value initialization, which has the effect of
initializing ptr to zero.  See the relevant section in the standard.

-- Gaby


-- 


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



More information about the Gcc-bugs mailing list