From patchwork Fri Jul 24 18:44:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 1335919 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=ivFVtW8G; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCym157nKz9sRK for ; Sat, 25 Jul 2020 04:44:16 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E2CD33857C6F; Fri, 24 Jul 2020 18:44:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E2CD33857C6F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1595616252; bh=MMvmZc272d6B1Wa0etvIGtUIztJY/Yh4r3BwgxNFpMU=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ivFVtW8GduP7sWpqZfLpiq5mIil1aUVUIqinAvu+gRF+KU2qp9UgqUwJeYQ6Ta8oP LYyBYpZZ4BIZP/KYwnQhIco5cA2cMms+4kscc6G4eSbN7LrPxfkKgCqXlfeLx/URHZ 4gBeAD5LFTG/WfE8BdZ7MZAiIWtmqYAvcFsPZIpU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id 25E313857C50 for ; Fri, 24 Jul 2020 18:44:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 25E313857C50 Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-144-a6x6MmBAOkyFnIy96KWI6A-1; Fri, 24 Jul 2020 14:44:09 -0400 X-MC-Unique: a6x6MmBAOkyFnIy96KWI6A-1 Received: by mail-qt1-f197.google.com with SMTP id h24so6536783qtk.18 for ; Fri, 24 Jul 2020 11:44:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MMvmZc272d6B1Wa0etvIGtUIztJY/Yh4r3BwgxNFpMU=; b=fXks6mdmDwjPA1nDT+3DDxQeHp5Z3+4Hm9YmeoXhe38mQPYW8f8MCttLEaZSqqJscD H17NgtQ3EDPTdc0czDDnXsvShJVBfs3FcqrY5KUhbWXEbcQVJTSpfCPOt10/n+ApMcOE Jsj5ummZPb6rhKVSGb8ifZ3bU2BFev0uHXfiKXc9/MHqlABHUZHahRgMK0v21Gh42VGy ZU8wvL0osCFkWhJCZcOYLvPr3K1aMB08jNUkpdKTaNcLrNS06hLoqTuXC3M6zY+GvO1n BtvReMzyc3sMmzawdSDlAa6TbrRxUKRB0Eg6/EfTqG09ajGf5Rv/I7MkIvdH00cold7k R87w== X-Gm-Message-State: AOAM531B28QAUaw3I3s681WFnS5GMyJFtE5EGENRu+tt+MPkl6CAlQoD 8ksNTur3BlFVmtFH9AiyeRzoQG5/1QLCVmk7gNrSvaq9zAd0dcX+Cu4e9nHu4BuTkk15nMRsY4I RtaYv9FmqJia9lRxORQ== X-Received: by 2002:a0c:b61d:: with SMTP id f29mr10811118qve.249.1595616248520; Fri, 24 Jul 2020 11:44:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzABaBV9t8mSu1jSZqVuM7fIS2R2HfY5ZfNOsTCtUdbsMf+4LERN31zsBMS/6AQEfuQnTvg9g== X-Received: by 2002:a0c:b61d:: with SMTP id f29mr10811106qve.249.1595616248345; Fri, 24 Jul 2020 11:44:08 -0700 (PDT) Received: from localhost.localdomain (ool-457d493a.dyn.optonline.net. [69.125.73.58]) by smtp.gmail.com with ESMTPSA id m20sm696959qtg.5.2020.07.24.11.44.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 11:44:07 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [COMMITTED] c++: Add testcase for [PR81339] Date: Fri, 24 Jul 2020 14:44:00 -0400 Message-Id: <20200724184400.3928062-1-ppalka@redhat.com> X-Mailer: git-send-email 2.28.0.rc1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, UNWANTED_LANGUAGE_BODY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Patrick Palka via Gcc-patches From: Patrick Palka Reply-To: Patrick Palka Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" We correctly reject this testcase since r11-434, i.e. since the fix for PR c++/57943. gcc/testsuite/ChangeLog: PR c++/81339 * g++.dg/cpp0x/decltype78.C: New test. --- gcc/testsuite/g++.dg/cpp0x/decltype78.C | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/decltype78.C diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype78.C b/gcc/testsuite/g++.dg/cpp0x/decltype78.C new file mode 100644 index 00000000000..6f4e5b4ad3b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype78.C @@ -0,0 +1,24 @@ +// PR c++/81339 +// { dg-do compile { target c++11 } } + +struct true_type { static const bool value = true; }; +struct false_type { static const bool value = false; }; + +template +struct IsDefaultConstructibleT +{ + // using T here (instead of U) should be an error + template // { dg-error "deleted" } + static true_type test(void*); + + template + static false_type test(...); + + static constexpr bool value = decltype(test(nullptr))::value; +}; + +struct S { + S() = delete; +}; + +static_assert( IsDefaultConstructibleT::value, "" ); // { dg-error "assertion failed" }