From patchwork Mon Jul 26 23:08:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Rivas X-Patchwork-Id: 59956 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 A4F9CB70BB for ; Tue, 27 Jul 2010 09:09:02 +1000 (EST) Received: (qmail 14317 invoked by alias); 26 Jul 2010 23:09:00 -0000 Received: (qmail 14306 invoked by uid 22791); 26 Jul 2010 23:08:59 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, TW_CX, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Jul 2010 23:08:49 +0000 Received: by wyb38 with SMTP id 38so2998483wyb.20 for ; Mon, 26 Jul 2010 16:08:47 -0700 (PDT) Received: by 10.227.138.6 with SMTP id y6mr7976002wbt.162.1280185727065; Mon, 26 Jul 2010 16:08:47 -0700 (PDT) Received: from [10.0.0.11] (201.Red-88-9-141.dynamicIP.rima-tde.net [88.9.141.201]) by mx.google.com with ESMTPS id i25sm3601285wbi.22.2010.07.26.16.08.45 (version=SSLv3 cipher=RC4-MD5); Mon, 26 Jul 2010 16:08:46 -0700 (PDT) Subject: [PATCH, C++] PR43824 pedantic with inline namespaces From: Rodrigo To: gcc-patches@gcc.gnu.org Date: Tue, 27 Jul 2010 01:08:44 +0200 Message-ID: <1280185724.5689.2.camel@abajo> Mime-Version: 1.0 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 Hello. The following patch adds the pedantic warning to inline namespaces if the compiler is not in C++0x mode, as commented in PR43824. Regards. --- Rodrigo. Index: parser.c =================================================================== --- parser.c (revision: 162531) +++ parser.c (copia de trabajo) @@ -13210,6 +13210,9 @@ cp_parser_namespace_definition (cp_parse if (cp_lexer_next_token_is_keyword (parser->lexer, RID_INLINE)) { + if (cxx_dialect < cxx0x && !in_system_header) + pedwarn (input_location, OPT_pedantic, + "ISO C++98 does not allow inline namespaces"); is_inline = true; cp_lexer_consume_token (parser->lexer); }