From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3435 invoked by alias); 26 Jun 2011 08:37:53 -0000 Received: (qmail 3308 invoked by uid 22791); 26 Jun 2011 08:37:51 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 26 Jun 2011 08:37:38 +0000 From: "indi.in.the.wired at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/49445] Undefined reference to std::atomic "operator float" X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: indi.in.the.wired at gmail dot com X-Bugzilla-Status: WAITING X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Sun, 26 Jun 2011 08:37:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg02240.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49445 Mark A. Gibbs changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |indi.in.the.wired at gmail | |dot com --- Comment #6 from Mark A. Gibbs 2011-06-26 08:37:09 UTC --- (In reply to comment #5) > You are right, I thought it worked for all fundamental types but reviewing the > proposal [1] makes me realise I was wrong. It remains unclear wether user > defined enums should work ... According to 29.5.1 in the draft standard i have (n3242): "There is a generic class template atomic. The type of the template argument T shall be trivially copyable (3.9)." That wording is in several older drafts, too, going back to at least March 2010, so it's not new and probably won't change. So it *should* work for all fundamental types, and even user-defined types (classes) provided they're trivially copyable. Both float and scoped enums are trivially copyable, so atomic and atomic should work. What the standard says about integral types is just that specializations already exist for them (like specialization atomic exists, and publicly inherits from atomic_int).