From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127131 invoked by alias); 25 Mar 2015 21:45:21 -0000 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 Received: (qmail 127077 invoked by uid 48); 25 Mar 2015 21:45:17 -0000 From: "eldlistmailingz at tropicsoft dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65547] Gcc not giving preprocessor error for invalid invocation of variadic macro Date: Wed, 25 Mar 2015 22:53: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-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: eldlistmailingz at tropicsoft dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg02869.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65547 --- Comment #6 from Edward Diener --- (In reply to Jonathan Wakely from comment #4) > (In reply to Edward Diener from comment #3) > > Where do you get the idea that the standard doesn't require an error, it > > requires a diagnostic message ? > > 1.4 [intro.compliance], the text I quoted. Where do you get the idea it > requires an error? You are not following the C++ standard as specified by the section I quoted. Does gcc just decide arbitrarily if it does not follow the C++ standard it can either issue an error, warning, or diagnostic message. That is an odd way to create a language compiler. Is not the idea of a compiler like gcc that it should follow the C++ standard as to be a standard-conforming compiler, and if the end-user writes C++ code that does not follow the C++ standard an error should be issued by the compiler ? I am clearly missing something here. The C++ standard, in the section/paragraph I quoted, is saying that when a macro accepts variadic parameters as its final parameter, some input, even if it is an argument consisting of no preprocessing tokens, must be passed for the variadic parameter. In the example I gave, no argument at all is being passed for the variadic parameter. If the invocation had been VMACRO(1,) then there is no problem. But some argument must be passed.