From patchwork Thu Dec 22 20:27:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 708339 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 3tl34s0bfDz9t0H for ; Fri, 23 Dec 2016 07:28:28 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="aT1xGiFr"; 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 :mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; q=dns; s=default; b=iSTrdw6LqrXQDQ83+5 5ydg9DfY7cCsEVbEmapjMigc6jacdYIDsKs5p4SEo2Xzc56INKQc3cALHWRAlQHN aKMijItiZ07IKZps7Y+CMk0U6p1gL7jS24+bU7piHdnr7jNBPh0Rx1IybMk/HuEm EvgCv1tLpM0u/KINmjTBZQQv0= 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 :mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; s=default; bh=WN4xcvgHxJTXJ6/8ipZ4D0s5 39w=; b=aT1xGiFrX4GppCri4RY6ZsBvYg88xcTHxViRzWT6g+e5m3CrWBDTv+JZ 0M0JEbO41Cm5OxUP80N+G/tKuMNmJPiCzNl5bYSYUFJgWCFM1Ilx73AZ+f5HNNg4 7StR+FwTgtCbNq4/uiq3Stselju7si6n7QAJ+3bOi0u6EG/0hGI= Received: (qmail 35787 invoked by alias); 22 Dec 2016 20:28:21 -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 35777 invoked by uid 89); 22 Dec 2016 20:28:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=sk:__cpp_t, maybe_unused, stage3, P0522R0 X-HELO: mail-oi0-f50.google.com Received: from mail-oi0-f50.google.com (HELO mail-oi0-f50.google.com) (209.85.218.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Dec 2016 20:28:19 +0000 Received: by mail-oi0-f50.google.com with SMTP id b126so253028431oia.2 for ; Thu, 22 Dec 2016 12:28:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=zVfT9EsMa/FYLZCK72FntJLMZ/YlfvHPmzC02c2OZ3w=; b=jk6BTlMPs1OpnDdUmAzvhYJPhbOEyhUCLDsUc78ASNFWbCRwpKLNoa/75lBJV/i1qP f/yHXInEAAxGNKPxFnXes+cXqquHNdJhHxeDNLwATd5xLIrtruNgfPiHaqO8Scf0T5Yn 4kUYH/wSTSoAzUmNQOl3JNMynzuX3250ci0kpq9ofVW2F75wgYw0LY7R+oqJ3kh1UN15 LTuw3OjEE+69EG1CWbqpLmVSP2CR0C1/COIQKEWfVZMjgGexOsqLloA2rWX+EdJQTwsr x54TYoc5fLeVXWdqKLaMRkGNqdVydQvzW5dgYBKCJuLaA81WzoaPzELoi/5JzLKwFJTs GSrw== X-Gm-Message-State: AIkVDXICJmd46mNETZ1uYtO6PMV2uMPUkbLsqHvycw7FVV6PZge9tQghWo/8qJVISvgvUi0va+C0TaoEahigOone X-Received: by 10.202.53.2 with SMTP id c2mr6215981oia.80.1482438497973; Thu, 22 Dec 2016 12:28:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.177.73 with HTTP; Thu, 22 Dec 2016 12:27:57 -0800 (PST) In-Reply-To: References: From: Jason Merrill Date: Thu, 22 Dec 2016 15:27:57 -0500 Message-ID: Subject: Re: C++ PATCH for c++/42329, P0522 and other template template parm issues To: gcc-patches List X-IsSubscribed: yes On Wed, Dec 21, 2016 at 4:06 PM, Jason Merrill wrote: > The last patch implements paper P0522, which resolves DR150 to clarify > that default arguments do make a template suitable as an argument to a > template template-parameter based on a new rule that the > template-parameter must be more specialized (as newly defined) than > the argument template. This is a defect report that will apply to all > standard levels, but since we're in stage3 I limited it by default to > C++17 for GCC 7; it can also be explicitly enabled with > -fnew-ttp-matching. And this adds a feature-test macro I proposed to SG10. commit 2396126078c49cc17dacc905969febd1bdd7caa6 Author: Jason Merrill Date: Thu Dec 22 13:11:26 2016 -0500 Feature-test macro for P0522R0, matching of template template arguments. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_template_template_args. diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index e2419e8..a841e53 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -985,6 +985,8 @@ c_cpp_builtins (cpp_reader *pfile) cpp_define_formatted (pfile, "__STDCPP_DEFAULT_NEW_ALIGNMENT__=%d", aligned_new_threshold); } + if (flag_new_ttp) + cpp_define (pfile, "__cpp_template_template_args=201611"); } /* Note that we define this for C as well, so that we know if __attribute__((cleanup)) will interface with EH. */ diff --git a/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C b/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C index 086fd25..f61b9f5 100644 --- a/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C +++ b/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C @@ -398,6 +398,12 @@ # error "__cpp_structured_bindings != 201606" #endif +#ifndef __cpp_template_template_args +# error "__cpp_template_template_args" +#elif __cpp_template_template_args != 201611 +# error "__cpp_template_template_args != 201611" +#endif + #ifdef __has_cpp_attribute # if ! __has_cpp_attribute(maybe_unused)