From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128301 invoked by alias); 10 May 2018 19:21:17 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 128289 invoked by uid 89); 10 May 2018 19:21:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:489 X-HELO: gateway32.websitewelcome.com Received: from gateway32.websitewelcome.com (HELO gateway32.websitewelcome.com) (192.185.145.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 May 2018 19:21:14 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 5CF4E55D76AC for ; Thu, 10 May 2018 14:21:13 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id Gr7pftxCEBcCXGr7pfriZm; Thu, 10 May 2018 14:21:13 -0500 X-Authority-Reason: nr=8 Received: from 97-122-176-117.hlrn.qwest.net ([97.122.176.117]:34832 helo=pokyo) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1fGr7p-001Cb2-3O; Thu, 10 May 2018 14:21:13 -0500 From: Tom Tromey To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [RFA] inadvertent language switch during breakpoint_re_set_one References: <1525976353-67414-1-git-send-email-brobecker@adacore.com> Date: Thu, 10 May 2018 19:29:00 -0000 In-Reply-To: <1525976353-67414-1-git-send-email-brobecker@adacore.com> (Joel Brobecker's message of "Thu, 10 May 2018 14:19:13 -0400") Message-ID: <87fu2z1fmf.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fGr7p-001Cb2-3O X-Source-Sender: 97-122-176-117.hlrn.qwest.net (pokyo) [97.122.176.117]:34832 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-SW-Source: 2018-05/txt/msg00252.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Joel> + explicit scoped_restore_current_language_mode () Joel> + : m_lang_mode (language_mode) Joel> + { Joel> + } Joel> + Joel> + ~scoped_restore_current_language_mode () Joel> + { Joel> + language_mode = m_lang_mode; Joel> + } [...] Joel> + enum language_mode m_lang_mode; For a plain scalar you can just use scoped_restore and make_scoped_restore. Tom