From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20156 invoked by alias); 7 Oct 2011 18:21:29 -0000 Received: (qmail 20144 invoked by uid 22791); 7 Oct 2011 18:21:28 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 07 Oct 2011 18:21:14 +0000 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/50660] warning about pass NULL to non pointer argument happens twice for template function call Date: Fri, 07 Oct 2011 18:21:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: trivial X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Keywords Status Last reconfirmed Component Summary Known to fail Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00531.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D50660 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic Status|WAITING |NEW Last reconfirmed|2011-10-07 00:00:00 | Component|other |c++ Summary|gcc repeats warnings twice |warning about pass NULL to | |non pointer argument | |happens twice for template | |function call Known to fail| |4.5.0, 4.7.0 --- Comment #2 from Andrew Pinski 2011-10-07 1= 8:20:51 UTC --- Simplified testcase: #include template int f(T&); int main(void) { return f(NULL); } --- CUT --- t.cc: In function =E2=80=98int main()=E2=80=99: t.cc:6:27: warning: passing NULL to non-pointer argument 1 of =E2=80=98int = f(T&) [with T =3D const int]=E2=80=99 [-Wconversion-null] t.cc:6:27: warning: passing NULL to non-pointer argument 1 of =E2=80=98int = f(T&) [with T =3D const int]=E2=80=99 [-Wconversion-null] It only happens with template functions too. Confirmed.