From patchwork Thu Jul 9 16:09:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 493475 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 37CE7140295 for ; Fri, 10 Jul 2015 02:09:37 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=VUx77okz; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=DOrRh/ILK7M0FWVe64S1F32STfHTd8bdunQvG8bE41G Ux++iC8ILvhhFUOtP2pJjtv7GUCYnTHEO1k9WvhV/FkhN4LWhEOa92zoWL3Ub9dJ jeH/wEhk2+yADYj4xGHd4C2mUEs5VXQf+ji8Z3yxzUh1bx+mZX+6cHJlxPx0qoFY = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=k0gi0Jv1XWXtFCq0k+IR4hl30nU=; b=VUx77okzE6EcVDnxc qozyG1jKs1w+eKtLyq2AXAEWidLSNcruuOiBgrZAt9gY7TzvyVlmO8zE5mi9pGU4 Z82NpGnHVm8OxBAh0r6UK04Ytb7vgw+hx+yZ9yO8yAxShIb8tUYVw2UmyT5jF/xM s0wpdjWgKStP5L+iZg7Z90TKrQ= Received: (qmail 90636 invoked by alias); 9 Jul 2015 16:09:30 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 90617 invoked by uid 89); 9 Jul 2015 16:09:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, RP_MATCHES_RCVD, SPF_PASS autolearn=no version=3.3.2 X-HELO: userp1040.oracle.com Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 09 Jul 2015 16:09:29 +0000 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t69G9QIL018296 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 9 Jul 2015 16:09:26 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t69G9QoW026896 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 9 Jul 2015 16:09:26 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t69G9Q4k017337; Thu, 9 Jul 2015 16:09:26 GMT Received: from [192.168.1.4] (/79.35.231.59) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 09 Jul 2015 09:09:25 -0700 Message-ID: <559E9CB3.3070102@oracle.com> Date: Thu, 09 Jul 2015 18:09:23 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: [C++ Patch] PR 61491 (aka DR 1206) X-IsSubscribed: yes Hi, the DR got resolved in time for C++11 and Jonathan noticed that we should remove the pedwarn, not a big deal. Tested x86_64-linux. Thanks, Paolo. ////////////////// /cp 2015-07-09 Paolo Carlini PR c++/61491 * pt.c (maybe_process_partial_specialization): Allow enum template specializations. /testsuite 2015-07-09 Paolo Carlini PR c++/61491 * g++.dg/cpp0x/enum30.C: New. Index: cp/pt.c =================================================================== --- cp/pt.c (revision 225614) +++ cp/pt.c (working copy) @@ -970,11 +970,10 @@ maybe_process_partial_specialization (tree type) } else if (processing_specialization) { - /* Someday C++0x may allow for enum template specialization. */ + /* Under DR 1206 enum template specializations are allowed. */ if (cxx_dialect > cxx98 && TREE_CODE (type) == ENUMERAL_TYPE && CLASS_TYPE_P (context) && CLASSTYPE_USE_TEMPLATE (context)) - pedwarn (input_location, OPT_Wpedantic, "template specialization " - "of %qD not allowed by ISO C++", type); + ; else { error ("explicit specialization of non-template %qT", type); Index: testsuite/g++.dg/cpp0x/enum30.C =================================================================== --- testsuite/g++.dg/cpp0x/enum30.C (revision 0) +++ testsuite/g++.dg/cpp0x/enum30.C (working copy) @@ -0,0 +1,20 @@ +// PR c++/61491 +// { dg-do compile { target c++11 } } + +template struct Base +{ + enum class E : unsigned; + E e; + Base(E e) : e(e) {} +}; + +struct X; + +template<> enum class Base::E : unsigned { a, b }; + +struct X : Base +{ + X() : Base(E::b) {} +}; + +X x;