From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129220 invoked by alias); 26 Jul 2015 17:50:41 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 129171 invoked by uid 89); 26 Jul 2015 17:50:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_20,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-ob0-f181.google.com Received: from mail-ob0-f181.google.com (HELO mail-ob0-f181.google.com) (209.85.214.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 26 Jul 2015 17:50:39 +0000 Received: by obdeg2 with SMTP id eg2so45346378obd.0 for ; Sun, 26 Jul 2015 10:50:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=rD/GEdlJNzqULkQdLvKNlp8jKFmCjWP/BtOPWfNYuhs=; b=azG90eagMEKgjcbCMCYy0KfFyRerCQRGJTO+gRf4T3/0n4r5ASNSt4t3UzU6OLAvBk LOKSzbJPi0UI7ySJQo2omSuy/gL7BK0IVTUACRYhmvs2ZGEyFGzQNrzYzevGz3e3LB54 tPdwrvbUs9URhpzBdJMzpAchF7PmA9atdJcyaC46kC+Ya2NK/o0cClmKP8goHXup1G51 pPRwZDE6lDJJud15KGa1iMqFGHZjP1DkjnF0F6RalpkePHQXCfxj0WgZ8+EyVrvqDHyZ L1jJ9AdoPyS4VdVsnca2ev0V1TMNZdGNrM4Z5VqDTeOK7tUQK4AuHgHc6Up3fqdr0Rgf olDA== X-Gm-Message-State: ALoCoQnR/+FtCvsqIXXEEAvttSGD2gcrVOi7Pseyqhy4sTLleI2iCr7n3+uznB0GLh6cLy6naZo/ X-Received: by 10.60.63.20 with SMTP id c20mr23703528oes.22.1437933037600; Sun, 26 Jul 2015 10:50:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.56.202 with HTTP; Sun, 26 Jul 2015 10:50:18 -0700 (PDT) In-Reply-To: References: <1437878959-10982-1-git-send-email-patrick@parcs.ath.cx> <55B4581F.1080900@redhat.com> From: Patrick Palka Date: Sun, 26 Jul 2015 19:10:00 -0000 Message-ID: Subject: Re: [PATCH] Fix PR c++/18969 (invalid return statement diagnosed too late) To: Jason Merrill Cc: GCC Patches , =?UTF-8?B?TWFudWVsIEzDs3Blei1JYsOhw7Fleg==?= Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-07/txt/msg02187.txt.bz2 On Sun, Jul 26, 2015 at 1:09 PM, Patrick Palka wrote: > Committed with this additional change to fix a latent testcase bug: > > diff --git a/gcc/testsuite/g++.old-deja/g++.jason/overload.C > b/gcc/testsuite/g++.old-deja/g++.jason/overload.C > index 6a747ff..28b029f 100644 > --- a/gcc/testsuite/g++.old-deja/g++.jason/overload.C > +++ b/gcc/testsuite/g++.old-deja/g++.jason/overload.C > @@ -5,7 +5,7 @@ enum bar {}; > void operator+ (int, int);// { dg-error "" } .* > void operator+ (bar&, int); > > -template void operator+ (int b, T& t) { return b; } > +template void operator+ (int b, T& t) { return; } > void operator+ (int, bar&); > > template class foo Hmm, on second thought, I don't think this fix is right. It may be the case that the 'return b;' was there to make instantiation of that template a compile-time error. By changing it to 'return;' instantiation is allowed. Is this property important here? Should I preserve the original property (that instantiation is a compile-time error) by instead doing the following? Adjust g++.old-deja/g++.jason/overload.C gcc/testsuite/ChangeLog: * g++.old-deja/g++.jason/overload.C: Adjust to preserve original property that instantiation is a compile-time error. diff --git a/gcc/testsuite/g++.old-deja/g++.jason/overload.C b/gcc/testsuite/g++.old-deja/g++.jason/overload.C index 28b029f..5d27713 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/overload.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/overload.C @@ -5,7 +5,7 @@ enum bar {}; void operator+ (int, int);// { dg-error "" } .* void operator+ (bar&, int); -template void operator+ (int b, T& t) { return; } +template void operator+ (int b, T& t) { (void) T::bogus; } void operator+ (int, bar&); template class foo