From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#24195: 25.0.95; Wrong indentation after a 'less < than' comparison (c++-mode) Date: Thu, 11 Aug 2016 12:14:21 +0000 Message-ID: <20160811121421.GA3753@acm.fritz.box> References: <86a8glhsk3.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1470917732 29307 195.159.176.226 (11 Aug 2016 12:15:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 11 Aug 2016 12:15:32 +0000 (UTC) User-Agent: Mutt/1.5.24 (2015-08-30) Cc: 24195@debbugs.gnu.org To: Arash Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 11 14:15:28 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXotR-0007Nv-Ou for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Aug 2016 14:15:25 +0200 Original-Received: from localhost ([::1]:48218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXotO-0004Fg-ET for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Aug 2016 08:15:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXotI-0004FP-Aq for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 08:15:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXotC-00025c-03 for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 08:15:16 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXot4-0001zT-8l; Thu, 11 Aug 2016 08:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bXot3-0003LV-VX; Thu, 11 Aug 2016 08:15:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 11 Aug 2016 12:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24195 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 24195-submit@debbugs.gnu.org id=B24195.147091769712835 (code B ref 24195); Thu, 11 Aug 2016 12:15:01 +0000 Original-Received: (at 24195) by debbugs.gnu.org; 11 Aug 2016 12:14:57 +0000 Original-Received: from localhost ([127.0.0.1]:53083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXosz-0003Kx-7t for submit@debbugs.gnu.org; Thu, 11 Aug 2016 08:14:57 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:18717) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXosx-0003Ko-64 for 24195@debbugs.gnu.org; Thu, 11 Aug 2016 08:14:55 -0400 Original-Received: (qmail 24229 invoked by uid 3782); 11 Aug 2016 12:14:53 -0000 Original-Received: from acm.muc.de (p548C6115.dip0.t-ipconnect.de [84.140.97.21]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 11 Aug 2016 14:14:51 +0200 Original-Received: (qmail 3815 invoked by uid 1000); 11 Aug 2016 12:14:21 -0000 Content-Disposition: inline In-Reply-To: <86a8glhsk3.fsf@gmail.com> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:122067 Archived-At: Hello, Arash. On Wed, Aug 10, 2016 at 02:08:52PM +0430, Arash wrote: > $ emacs -Q test.cc > bool test() > { > return \ > a() <= b() && > c() >= d() && > e() == f() && > g() != h() && > i() > j() && > k() < l() && ^ > m() == n() // !!! > ; > } Yes. In the line "k() < l() &&", the "<" is being recognised as a template opener. The syntax of C++ is ambiguous, and it is difficult for anything which isn't a compiler reliably to distinguish between "less than" and "open template" in circumstances like that. It was easier for earlier versions of C++, where the "&&" operator wasn't valid inside a template. I'm not sure I can do very much to help, here. Even waiting on the closing ">" before recognising a template wouldn't help much, because you're just as likely to have the line with "<" before the line with ">". There are crude workarounds, like writing "!(k() >= l()), but that's horrible. So, sorry and all that, I don't think I can do anything to fix this. -- Alan Mackenzie (Nuremberg, Germany).