From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15202 invoked by alias); 21 Dec 2011 05:40:12 -0000 Received: (qmail 15187 invoked by uid 22791); 21 Dec 2011 05:40:07 -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; Wed, 21 Dec 2011 05:39:53 +0000 From: "ramey at rrsd dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/51630] failure to detect missing Date: Wed, 21 Dec 2011 07:22: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: X-Bugzilla-Severity: normal X-Bugzilla-Who: ramey at rrsd dot com X-Bugzilla-Status: CLOSED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Resolution 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" 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-12/txt/msg02317.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51630 Robert Ramey changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |WONTFIX --- Comment #7 from Robert Ramey 2011-12-21 05:39:49 UTC --- what I expected was that -fsyntax-only would run the normal process but skip the code generation. I don't think that's an unreasonable expectation from the name of the option and the simple description of it. Also I wouldn't characterize the program as not having any syntax errors. The first example name test2(){ name x, y; return (x < y) ? y : x; } generates an compile time error as one would expect. If the same code were placed inside a macro, it would also provoke an error. Then you move it into at template - and voila - no syntax error. This is not regular or intuitive behavior. When you tested it you also expected to see an error - to the extent you tried on several versions of gcc. If your asking me what I want, I would respond that the current behavior of the -fsyntax-only is inconsistent and confusing and has room for improvement. It's not much of an answer to say "don't do that". Taken to it's logical conclusion, you might just skip emission of compile time errors all together and replace them with the admonition - don't write incorrect code ! Anyway, thanks again for detecting this. Robert Ramey