Return-Path: Delivered-To: apmail-stdcxx-issues-archive@locus.apache.org Received: (qmail 62623 invoked from network); 2 Jul 2008 22:13:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jul 2008 22:13:17 -0000 Received: (qmail 25751 invoked by uid 500); 2 Jul 2008 22:13:18 -0000 Delivered-To: apmail-stdcxx-issues-archive@stdcxx.apache.org Received: (qmail 25730 invoked by uid 500); 2 Jul 2008 22:13:18 -0000 Mailing-List: contact issues-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list issues@stdcxx.apache.org Received: (qmail 25719 invoked by uid 99); 2 Jul 2008 22:13:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jul 2008 15:13:18 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jul 2008 22:12:24 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id EE93A234C148 for ; Wed, 2 Jul 2008 15:12:44 -0700 (PDT) Message-ID: <742764237.1215036764972.JavaMail.jira@brutus> Date: Wed, 2 Jul 2008 15:12:44 -0700 (PDT) From: "Travis Vitek (JIRA)" To: issues@stdcxx.apache.org Subject: [jira] Commented: (STDCXX-983) [Linux/gcc] 20.meta.unary.prop.cpp fails is_pod assertions In-Reply-To: <457179356.1215036284984.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/STDCXX-983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610069#action_12610069 ] Travis Vitek commented on STDCXX-983: ------------------------------------- This is the documentation for the helper (taken from [here|http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Type-Traits.html#Type-Traits]) __is_pod (type){quote}If type is a cv POD type ([basic.types]) then the trait is true, else it is false. Requires: type shall be a complete type, an array of unknown bound or is a void type.{quote} Here are the pertenent sections of the standard 3.9 p9{quote}Scalar types, POD classes (clause 9), arrays of such types and cv-qualified versions of these types (3.9.3) are collectively called POD types. Scalar types, trivial class types (clause 9), arrays of such types and cv-qualified versions of these types (3.9.3) are collectively called trivial types. Scalar types, standard-layout class types (clause 9), arrays of such types and cv-qualified versions of these types (3.9.3) are collectively called standard-layout types.{quote} 9 p5{quote}a trivial class is a class that -- has a trivial default constructor -- has a trivial copy constructor -- has a trivial copy assignment operator -- has a trivial destructor {quote} 9 p6{quote}a standard-layout class is a class that -- has no non-static data members of type non-standard-layout class (or array of such types) or reference -- has no virtual functions and no virtual base classes -- has the same access control for all non-static data members -- has no non-standard-layout base classes -- either has no non-static data members in the most-derived class and at most one base class with non-static data members, or has no base classes with non-static data members -- has no base classes of the same type as the first non-static data member {quote} 9 p9{quote}a POD struct is a class that is both a trivial class and a standard-layout class, and has no non-static data members of type non-POD struct, non-POD union (or array of such types). Similarly, a POD union is a union that is both a trivial class and a standard layout class, and has no non-static data members of type non-POD struct, non-POD union (or array of such types).A POD class is a class that is either a POD struct or a POD union.{quote} > [Linux/gcc] 20.meta.unary.prop.cpp fails is_pod assertions > ---------------------------------------------------------- > > Key: STDCXX-983 > URL: https://issues.apache.org/jira/browse/STDCXX-983 > Project: C++ Standard Library > Issue Type: Bug > Components: TR1.4 - Metaprogramming and Type Traits > Affects Versions: 4.3 > Environment: gcc-4.3 > Reporter: Travis Vitek > Fix For: 4.3 > > > I'm pretty confident that the following should compile and run without failure. It abbends with SIGABRT with recent versions of gcc-4.3. > {noformat} > $ cat t.cpp && g++ t.cpp && ./a.out > #include > struct empty_t > { > }; > struct trivial_t > { > long value; > }; > template > struct public_derived_t : T > { > }; > int main () > { > assert (__is_pod(trivial_t)); > assert (__is_pod(public_derived_t)); > assert (__is_pod(empty_t)); > assert (__is_pod(public_derived_t)); > return 0; > } > a.out: t.cpp:20: int main(): Assertion `__is_pod(public_derived_t)' failed. > Aborted > {noformat} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.