From patchwork Mon Aug 23 14:45:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Rivas X-Patchwork-Id: 62489 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 2AF59B6EDD for ; Tue, 24 Aug 2010 00:45:52 +1000 (EST) Received: (qmail 20435 invoked by alias); 23 Aug 2010 14:45:49 -0000 Received: (qmail 20426 invoked by uid 22791); 23 Aug 2010 14:45:49 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE 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, 23 Aug 2010 14:45:44 +0000 Received: by wyb33 with SMTP id 33so5130121wyb.20 for ; Mon, 23 Aug 2010 07:45:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.128.144 with SMTP id k16mr4566729wbs.196.1282574742023; Mon, 23 Aug 2010 07:45:42 -0700 (PDT) Received: by 10.216.53.137 with HTTP; Mon, 23 Aug 2010 07:45:41 -0700 (PDT) In-Reply-To: <4C6C5BD8.30606@redhat.com> References: <1280185724.5689.2.camel@abajo> <4C6C5BD8.30606@redhat.com> Date: Mon, 23 Aug 2010 16:45:41 +0200 Message-ID: Subject: Re: [PATCH, C++] PR43824 pedantic with inline namespaces From: Rodrigo Rivas To: Jason Merrill Cc: gcc-patches@gcc.gnu.org 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 > I'd prefer to add this warning to maybe_warn_cxx0x and then just call that > function here. No problem, how about this? Regards. Rodrigo. Index: gcc/cp/error.c =================================================================== --- gcc/cp/error.c (revision 163449) +++ gcc/cp/error.c (working copy) @@ -3029,6 +3029,11 @@ maybe_warn_cpp0x (cpp0x_warn_str str) "defaulted and deleted functions " "only available with -std=c++0x or -std=gnu++0x"); break; + case CPP0X_INLINE_NAMESPACES: + pedwarn (input_location, 0, + "inline namespaces " + "only available with -std=c++0x or -std=gnu++0x"); + break; default: gcc_unreachable(); } Index: gcc/cp/parser.c =================================================================== --- gcc/cp/parser.c (revision 163449) +++ gcc/cp/parser.c (working copy) @@ -13246,6 +13447,7 @@ cp_parser_namespace_definition (cp_parser* parser) if (cp_lexer_next_token_is_keyword (parser->lexer, RID_INLINE)) { + maybe_warn_cpp0x (CPP0X_INLINE_NAMESPACES); is_inline = true; cp_lexer_consume_token (parser->lexer); } Index: gcc/cp/cp-tree.h =================================================================== --- gcc/cp/cp-tree.h (revision 163449) +++ gcc/cp/cp-tree.h (working copy) @@ -387,7 +387,9 @@ typedef enum cpp0x_warn_str /* scoped enums */ CPP0X_SCOPED_ENUMS, /* defaulted and deleted functions */ - CPP0X_DEFAULTED_DELETED + CPP0X_DEFAULTED_DELETED, + /* inline namespaces */ + CPP0X_INLINE_NAMESPACES } cpp0x_warn_str; /* The various kinds of operation used by composite_pointer_type. */