From patchwork Wed Dec 9 15:38:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 554694 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 0E892140291 for ; Thu, 10 Dec 2015 02:38:41 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=s9xiBSv2; 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:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=w2QU/35Kug+sXXhCI2oRgVreBIIYRjJUZTydcLnjBn1xUu6tYDnEF D5LzzZicZvRO+Kxr7v/ac2qHoS8HhuF48jSxVFk5XqJTFoR+Iw4TwBBwG0vHo2iV qg+cYoRfB9Bv1K6PXA6NuhH1kitgvqX9C7ksdiohisi1Svf3TpCG0A= 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; s= default; bh=cqiB9+XpxzAsvGI2h0YlqmvGqqc=; b=s9xiBSv2/r+qggJcTUKX pLtV4g/NSyWI820q91Rtz+ri8d9imj2WOx9B80fzaVhVG1sranUOu03Jg9NUqHHR dSyynQWBnIyWw9SXt5qWJiIpvVZE0CqntWImCx4bkOe6ZpAGnVLQE+MuhGWASXE6 ihwN5lv0oAywJYMY+tKFo3Y= Received: (qmail 20368 invoked by alias); 9 Dec 2015 15:38:33 -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 20355 invoked by uid 89); 9 Dec 2015 15:38:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 09 Dec 2015 15:38:32 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id C570DA04B3 for ; Wed, 9 Dec 2015 15:38:30 +0000 (UTC) Received: from redhat.com (ovpn-204-18.brq.redhat.com [10.40.204.18]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB9FcQvx021164 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 9 Dec 2015 10:38:29 -0500 Date: Wed, 9 Dec 2015 16:38:25 +0100 From: Marek Polacek To: GCC Patches , Jason Merrill Subject: [PATCH] Add testcase for c++/68348 Message-ID: <20151209153825.GS3175@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) This adds a testcase for the already fixed PR68348. Tested on x86_64-linux, ok for trunk? 2015-12-09 Marek Polacek PR c++/68348 * g++.dg/cpp0x/pr68348.C: New test. Marek diff --git gcc/testsuite/g++.dg/cpp0x/pr68348.C gcc/testsuite/g++.dg/cpp0x/pr68348.C index e69de29..9033bba 100644 --- gcc/testsuite/g++.dg/cpp0x/pr68348.C +++ gcc/testsuite/g++.dg/cpp0x/pr68348.C @@ -0,0 +1,18 @@ +// PR c++/68348 +// { dg-do compile { target c++11 } } + +struct C { + constexpr C() : w(), x(), y() {} + constexpr double fn() const noexcept; + double w; + double x; + double y; +}; + +constexpr double C::fn() const noexcept { return w; } +C foo() +{ + C c; + c.fn (); + return c; +}