From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34100 invoked by alias); 5 Nov 2016 03:05:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 34086 invoked by uid 89); 5 Nov 2016 03:05:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=H*UA:Webmail, H*u:Webmail, H*UA:Roundcube, H*u:Roundcube X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 05 Nov 2016 03:05:42 +0000 Received: by simark.ca (Postfix, from userid 33) id 4067E1E18F; Fri, 4 Nov 2016 23:05:41 -0400 (EDT) To: Pedro Alves Subject: Re: [PATCH 2/3] enum_flags: Fix problems and add comprehensive unit tests X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Sat, 05 Nov 2016 03:05:00 -0000 From: Simon Marchi Cc: gdb-patches@sourceware.org In-Reply-To: <1478229738-24469-3-git-send-email-palves@redhat.com> References: <1478229738-24469-1-git-send-email-palves@redhat.com> <1478229738-24469-3-git-send-email-palves@redhat.com> Message-ID: <5a7059d542949c17d191a9be8e51a1a6@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.2 X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00106.txt.bz2 On 2016-11-03 23:22, Pedro Alves wrote: > +/* The (real) enum types used in CHECK_VALID. Their names match the > + template parameter names of the templated defined by CHECK_VALID > + just matching real vs template param type more obvious. They could > + be named differently. */ I think something is not right with the second sentence. > +/* Invalid since each type can be converted to the other. */ > +/* GCC 4.8 incorrectly fails to compile this test with: > + error: operands to ?: have different types ‘enum_flags’ and > ‘RE’ > + Confirmed to compile/pass with gcc 4.9, 5.3 and clang 3.7. > +*/ > +#if GCC_VERSION >= 4009 Does this #if enables testing with clang? > +CHECK_VALID (false, void, true ? EF () : RE ()) > +CHECK_VALID (false, void, true ? RE () : EF ()) > +#endif