From patchwork Mon Dec 19 22:07:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 132325 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]) by ozlabs.org (Postfix) with SMTP id 3440CB7049 for ; Tue, 20 Dec 2011 09:07:57 +1100 (EST) Received: (qmail 29455 invoked by alias); 19 Dec 2011 22:07:55 -0000 Received: (qmail 29444 invoked by uid 22791); 19 Dec 2011 22:07:54 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Dec 2011 22:07:38 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBJM7csk009623 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 19 Dec 2011 17:07:38 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pBJM7bsu010255 for ; Mon, 19 Dec 2011 17:07:38 -0500 Received: from [0.0.0.0] (ovpn-113-21.phx2.redhat.com [10.3.113.21]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id pBJM7agu008333 for ; Mon, 19 Dec 2011 17:07:37 -0500 Message-ID: <4EEFB5A8.6050103@redhat.com> Date: Mon, 19 Dec 2011 17:07:36 -0500 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111112 Thunderbird/8.0 MIME-Version: 1.0 To: gcc-patches List Subject: C++ PATCH for c++/51530 (ICE in unify with nullptr) 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 Just missing a case. Tested x86_64-pc-linux-gnu, applying to trunk. commit cd8d1cb9501d6151febfba17c240f8bbba2d25af Author: Jason Merrill Date: Mon Dec 19 16:28:19 2011 -0500 PR c++/51530 * pt.c (unify): Handle NULLPTR_TYPE. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 66d4c3f..769b610 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -16614,6 +16614,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict, case BOOLEAN_TYPE: case ENUMERAL_TYPE: case VOID_TYPE: + case NULLPTR_TYPE: if (TREE_CODE (arg) != TREE_CODE (parm)) return unify_type_mismatch (explain_p, parm, arg); diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr26.C b/gcc/testsuite/g++.dg/cpp0x/nullptr26.C new file mode 100644 index 0000000..b7421b8 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/nullptr26.C @@ -0,0 +1,13 @@ +// PR c++/51530 +// { dg-options -std=c++0x } + +template +void f(T, U); + +template +void f(T, decltype(nullptr)); + +int main() +{ + f(1, nullptr); +}