Message ID | 20231027152625.1921608-1-ppalka@redhat.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp686741vqb; Fri, 27 Oct 2023 08:26:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE1svdtVTsPeuaImbnMiGqGAcl99FUWnom534M2pQt4X5dhwJq0m+gtoXhlG4J6rcB586CU X-Received: by 2002:a1f:2c08:0:b0:49a:1a56:945c with SMTP id s8-20020a1f2c08000000b0049a1a56945cmr3437302vks.13.1698420415670; Fri, 27 Oct 2023 08:26:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698420415; cv=pass; d=google.com; s=arc-20160816; b=BA4hgm0v0CUOzFDYhxlq+nTtDD3I4Jxs3/UaQF/3c0WnPDGU7zbLD2EWs/pJ8x/kM2 mlxZeJtMBy1ZZ95/dFd9kGZu9IR6wQaBWhsDYHZZQahhHu3Ts7R2E3f8gdMS4lZuMdb3 o3LaBMvWpfyYRD7//5jCtpOHriv2sYviK4SucNnivOCwhPcq1MzYA0PMLS/+xN2Qn+JO ACruDyUmg9infNHb+YfowV96UHVcR/Ky6lG/mzb7yy+8IaIuAySSZBSegMXgTFUdlKd7 aB/82IY44SBzwT68cm1Caoc4V4NqpxncEeA7Ny1b9Bst5ZLUHyrG0Tc9yLgj8HH8VwDh V2cQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=3tUGFhNH1PWn/9Zb2cYyRDJO0MLN1gab8wtZJ+33er4=; fh=1Hi9m88IqcWZGtfSxUrMGG+GBgL26N02X1SANXM6iTs=; b=iISSw/mRUGtWWlPR2P7vRMm7PSrocnBj34y9tRAhXb2CXazQj0KHs0Mv3SF3gDcd08 gcAoNyUSGIAWAsZStHO9MuoCJodI6jYteOgU0uL5PdUpNApagnfzyjHfPrHxIM4SFhXj fBqt6Vw0RxerGzAcGWyOP9HERgC+pAdIl2MGTE/LQ481/8jZzQZHejzFu92Mf0hW5B+o qvFgeTmM8pWylhuBmiihtQ6eC2NbMef8eF6N7ASJq8UY/Us2JnX1sr+jNcJoVvLUDDqD EO98urMbqZdOULmay8Q61DRMj5fbzDZUa/EUGpnlr1M6f2MXmxD/AjdZedVOPEcwSGGX QODA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hqET7HuY; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id v20-20020a05622a015400b00419576c2d1asi850218qtw.773.2023.10.27.08.26.55 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 08:26:55 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hqET7HuY; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6F2C0385C6C4 for <ouuuleilei@gmail.com>; Fri, 27 Oct 2023 15:26:55 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 315F03858C2B for <gcc-patches@gcc.gnu.org>; Fri, 27 Oct 2023 15:26:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 315F03858C2B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 315F03858C2B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698420392; cv=none; b=TpfOe84lA0+zZaUq0SqGaWWVBUVOOapy4VAvz5T9Zc5yrxJubxVqNWrojocn1LhUDEAADK1NvGZoSi7HQ9Kj3sy1RnDg+jXE9RZGZK2SqEcIV87vXaf6EtHMYtf/Db2MW9dlgRddFhe6KsFAqNHw7WxY/FGC+SHI476xbMpXxMM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698420392; c=relaxed/simple; bh=cO6YXP8LnVIbfk28GUTZ3BHtIQ+sgMF/iAbA2DR/wQ8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=UkTakMkFZxPHzBjPbjm4/KxhBMA9B6V+VM9CCcptcaHDVsyuadJniPWMKQEk9LgV1pU1Tl2HFWd1AWBAopn8JIWFwW/5tTRkVbnKOb3gMEtxvQkWTxQT5agKmpItDMJNTIvoo9SriHQT632YKNj7ED+xewDVTS7cZxBOb9HKqhk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698420390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3tUGFhNH1PWn/9Zb2cYyRDJO0MLN1gab8wtZJ+33er4=; b=hqET7HuYgLPXLpsLwJJ2jCF/2rKx/MmQTzq8Kf2S8DPTUX8Sf0JSzOVjpyvGOGxWmFkvI6 g8xG3WKBUaRx7C7j38LlxxDbw/MG+9wCGib/M7J0Hw8a0/Hd7tXZ9h0Ry6Dk5P1wIPe1NG D0NioZIDG1cQyrQ3tI7bCXnViFodUMc= Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com [209.85.222.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-532-F1ST2SrVN8qCAplllqrDMQ-1; Fri, 27 Oct 2023 11:26:29 -0400 X-MC-Unique: F1ST2SrVN8qCAplllqrDMQ-1 Received: by mail-ua1-f70.google.com with SMTP id a1e0cc1a2514c-7b7494e0314so785847241.1 for <gcc-patches@gcc.gnu.org>; Fri, 27 Oct 2023 08:26:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698420388; x=1699025188; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3tUGFhNH1PWn/9Zb2cYyRDJO0MLN1gab8wtZJ+33er4=; b=bMOQtPwJbLOaqfL+dmMXRVYp67IwV720V416RfkD7AnO3LxfRgnjc5f9klWfNXfX8c HKNYL51cWBJccJVIoccpYjIujA7S1n93emaOo2p755bXoNFOe+eH1w+VY9GmFtB19z7G R54WVm6AKGQ+W6spmDJc1QFeOqDTUOzBoertCbIO1qnebhBUoibU6b5vItyOaaHEJo6v Ocbruy3fJWdIDjjffAHfUzR5adZGQHW2YsfUeyrqipoxEySz4imHJpO42uHH0Q5MMiOI 6TssE7KrgkJOH/Q5q7g1n1sa+vmRGTqmbnymlOPBvtUH7Xwl2PURP0jNPSMtYnODfsrK Xk7Q== X-Gm-Message-State: AOJu0YxGTfV+DhmJvWlQb6J2xI2erYieU8a20DewR7S/U9Fm02hdlCCb 0e0yj5RqKmgl+sHqQqgEtTViio4S0e3WNonh7GXIDjI2gMjUIs/TdMUNkNtYLYlS2MSVT0x/cp5 gvKSJaXI9FnGh2X4kbO36bhjF0kc8v8TN4v4eXJD7LyP2zJ5icXcePoFxOBfG7D52d+hPh2yhz3 M= X-Received: by 2002:a67:c894:0:b0:457:c9ae:6c6e with SMTP id v20-20020a67c894000000b00457c9ae6c6emr3412446vsk.12.1698420388583; Fri, 27 Oct 2023 08:26:28 -0700 (PDT) X-Received: by 2002:a67:c894:0:b0:457:c9ae:6c6e with SMTP id v20-20020a67c894000000b00457c9ae6c6emr3412425vsk.12.1698420388261; Fri, 27 Oct 2023 08:26:28 -0700 (PDT) Received: from localhost.localdomain (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id iw13-20020a0562140f2d00b0066d0ab215b5sm693676qvb.13.2023.10.27.08.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 08:26:27 -0700 (PDT) From: Patrick Palka <ppalka@redhat.com> To: gcc-patches@gcc.gnu.org Cc: jason@redhat.com, Patrick Palka <ppalka@redhat.com> Subject: [pushed] c++: add testcase verifying non-dep new-expr checking Date: Fri, 27 Oct 2023 11:26:25 -0400 Message-ID: <20231027152625.1921608-1-ppalka@redhat.com> X-Mailer: git-send-email 2.42.0.482.g2e8e77cbac MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-13.6 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_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780922885785667170 X-GMAIL-MSGID: 1780922885785667170 |
Series |
[pushed] c++: add testcase verifying non-dep new-expr checking
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Patrick Palka
Oct. 27, 2023, 3:26 p.m. UTC
N.B. we currently don't diagnose 'new A(1)' below ultimately because when in a template context our valid ctor call checking only happens for type_build_ctor_call types. -- >8 -- gcc/testsuite/ChangeLog: * g++.dg/template/new14.C: New test. --- gcc/testsuite/g++.dg/template/new14.C | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 gcc/testsuite/g++.dg/template/new14.C
diff --git a/gcc/testsuite/g++.dg/template/new14.C b/gcc/testsuite/g++.dg/template/new14.C new file mode 100644 index 00000000000..8c0efe47ae2 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/new14.C @@ -0,0 +1,20 @@ +// Verify we check new-expressions ahead of time. + +struct A { }; +struct B { B(int); }; +struct C { void* operator new(__SIZE_TYPE__, int); }; + +template<class T> +void f() { + new A(1); // { dg-error "no match" "" { xfail *-*-* } } + new B(1, 2); // { dg-error "no match" } + new B; // { dg-error "no match" } + new C; // { dg-error "no match" } +} + + +template<class T> +void g() { + new int[__SIZE_MAX__]; // { dg-error "exceeds maximum" } + new int[__SIZE_MAX__ / sizeof(int)]; // { dg-error "exceeds maximum" } +}