From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 62F5C3858428 for ; Fri, 24 Dec 2021 12:21:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 62F5C3858428 Received: by mail-wm1-x329.google.com with SMTP id o30so2941009wms.4 for ; Fri, 24 Dec 2021 04:21:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2ikog7ThdcniXjSWqk/PXbVYVJTq4gl9FTtb0/4PkHI=; b=1PXSTtEKKNSxoICyKRA4yRW1rvAjeUCLhdVBuVDrVAj56cq9J/gI1NUOpkCuGuVKZp MAk1XWnkBSfYMWC1aDDzlxGKwO/QwXBzh+okuU2INlCD2lNlPEUK3sjGNAhE2B8+K4p3 Rz9myS+yDaRthI3R89AXn4Abr6iSWMZJO3tuCi1qvzK1rMj0KBNzDzekAZxsSBvtpVC+ /wxhJsZegn9PLm6OQNSrL/ItODtxoTEHC3SQjRnYDfJiybR/XtkyU0ey+HeZQXyzpdLm z9OAz3WzHEEdy8R4DZZD7JOdH0DNe2Vdw00WmXUzeHQUm4ytq8eqKdoGv29gemj19Zdo tXHA== X-Gm-Message-State: AOAM530ch0r5h8tqef10hTZgg8SImn4dpTmRe9ruDE3NhWUFLuzTV0Wr i66KzqpivSovNw1l0G5uG+yDi/itvUbPzwHPdxU= X-Google-Smtp-Source: ABdhPJxDYPqvBuKeCwz6pPHIHZ8U3v8vjQi5sLziXqfOTHFA1TyEfl5ZP6uPKil+EKhHwultnBw1/NieCyS+wksGWQE= X-Received: by 2002:a1c:9856:: with SMTP id a83mr4688345wme.157.1640348476569; Fri, 24 Dec 2021 04:21:16 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Fri, 24 Dec 2021 12:21:04 +0000 Message-ID: Subject: Re: Code style enforcement To: Tejasvi Singh Cc: "libstdc++" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Dec 2021 12:21:19 -0000 On Fri, 24 Dec 2021, 12:18 Jonathan Wakely, wrote: > > > On Fri, 24 Dec 2021, 10:45 Tejasvi Singh via Libstdc++, < > libstdc++@gcc.gnu.org> wrote: > >> Hi, >> >> While going through include/bits/stl-algo.h I noticed the return type is >> indented after template declaration. See below the indentation of return >> type _Function. The code formatting is enforced by clang-formatter (config >> at /contrib/clang-format) > > > > No it isn't. > > That file is for the compiler code, and is not used for libstdc++ code. I > don't think the tool supports the libstdc++ formatting style. Last I heard, > it has no way to do that indentation. > > > which does not indent the return type after template declaration. Is the >> inconsistency due to limitation of clang-format or a missing config option? >> >> template >> _Function >> for_each(_InputIterator __first, _InputIterator __last, _Function __f) >> { >> // concept requirements >> __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) >> __glibcxx_requires_valid_range(__first, __last); >> for (; __first != __last; ++__first) >> __f(*__first); >> return __f; // N.B. [alg.foreach] says std::move(f) but it's >> redundant. >> } >> >> Tejasvi >> >