From patchwork Fri Nov 8 21:38:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 1192269 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=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-512858-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="fAo2wQAj"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="ZhpHoHpd"; dkim-atps=neutral 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 478tv83HgSz9sPL for ; Sat, 9 Nov 2019 08:38:58 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=hNr9mGGcVD9qbCPe unwb7uvE8oZkKVlkeG8zGbbnJQflw9zQiI/5nT1QvkVUKf2TNk1YpJ5c52aujvyd vxQgO09cdlFMkvtFJqTwA4lulTuW34Y6dklu+GTjscllz6PW45ZVg2B9iaMMrAYB SzdAyPgFwHsq212HD5wYtg1UFFE= 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:date :from:to:subject:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=iZZ+mUxc5UAUizb3im7NSj vDPDI=; b=fAo2wQAj0sNMs2eDkWXBAaMPhlKUJW21vVkVVhJcjKkiR+EK7LTfIm VUyMKxW+pGczYhnErfqVZhGz99vCF08tpMsYuGH+4O4sgKCTEE0liqYPJ542S89+ +6TSx8JMyH7pQ3e17zA9uhIPBUtILOrIOlamhrYXpA4IqBmkBFJaE= Received: (qmail 10087 invoked by alias); 8 Nov 2019 21:38:50 -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 10076 invoked by uid 89); 8 Nov 2019 21:38:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-1.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Nov 2019 21:38:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573249127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YPR0FLk6HFdqZKi/tIkERV3maMRnK0p3qhKzCS/c6MQ=; b=ZhpHoHpdVmvCmN5AFg7ARssH1nlcE2eoAlPJ5PmiApJAut3A8st2QcTN8FxVasPLTv1ruT ilo+WYK+N+XUis/MuzfV4ArIvJooWioWnKY3duWhfvAS8QT38sF21O6iKw9PAldwW8EwRy j2rBAgaKbKhZRBzGPUkvtefKyyeA+0U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-390-5-2U3qoIN--ucrnjVOM3QA-1; Fri, 08 Nov 2019 16:38:45 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 854D31800D7B for ; Fri, 8 Nov 2019 21:38:44 +0000 (UTC) Received: from redhat.com (unknown [10.20.4.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4401C5D9C5 for ; Fri, 8 Nov 2019 21:38:44 +0000 (UTC) Date: Fri, 8 Nov 2019 16:38:42 -0500 From: Marek Polacek To: GCC Patches Subject: [C++ COMMITTED] Add test for c++/92058 Message-ID: <20191108213842.GA21634@redhat.com> MIME-Version: 1.0 User-Agent: Mutt/1.12.1 (2019-06-15) X-Mimecast-Spam-Score: 0 Content-Disposition: inline Another test for the constinit issue I fixed recently (c++/92134). Tested on x86_64-linux, applying to trunk. 2019-11-08 Marek Polacek PR c++/92058 - constinit malfunction in static data member. * g++.dg/cpp2a/constinit15.C: New test. diff --git gcc/testsuite/g++.dg/cpp2a/constinit15.C gcc/testsuite/g++.dg/cpp2a/constinit15.C new file mode 100644 index 00000000000..32594334330 --- /dev/null +++ gcc/testsuite/g++.dg/cpp2a/constinit15.C @@ -0,0 +1,14 @@ +// PR c++/92058 - constinit malfunction in static data member. +// { dg-do compile { target c++2a } } + +struct B { + B() {} +}; + +struct A { + constinit static inline B b1{}; // { dg-error "does not have a constant initializer|call to non-.constexpr. function" } +}; + +int main() { + A a; +}