From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id D912D3858C27 for ; Fri, 24 Dec 2021 12:18:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D912D3858C27 Received: by mail-wr1-x42c.google.com with SMTP id j18so17230139wrd.2 for ; Fri, 24 Dec 2021 04:18:47 -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=Lh0rfbqKtynfI3jIcavLbYuI98+cO4RpMX5Z0n+uKIw=; b=zJpPaJhc2EqaTqaiE3UX6KliHjPb1cz5mbTdC6sBdtYGpRJOePtWFsj4Ba1u3FiR7V fRJ+nF3SVnm1gDyUAmBXwN37V9qUjRS9rbvLvvPf8uEFLcKBTZnpSMQX8WsMqNN+M9Fm XqrLB4UpsLjiNQ3YEDYFgvYVJ5jY140jdx/hX0r0xz5VoXuOI1efpGRIM2EjKyvHLAuc koq40q0kRAqt0lOFE0GrCu5fZzMhwwkH01zI3pJeVyDHAR0D7B8v3I/GC2Va8vIK4V3g BQciDkJwWfO8sl/uqj7tw5sFPzWvb2wQydMz2951dj7ErvboocfIA9VfSs768ZHw1+pD lbMQ== X-Gm-Message-State: AOAM530wT6srlk4oR/RWNPtFYeuxmrA5GSGC2YFWYLZGifUgi1UbOuAa +eW+IS6DdKVHqb+ddsEC8YPfcV+mgacrQ8+Rbd4= X-Google-Smtp-Source: ABdhPJzbz3mhY4NcPG6YsLsDTvNa4G1O7FU5gjCB1FUXdRoFGG0GpvmO+tqCZQM7EZ7qIYEZB34LdzBPpFErazGbG1E= X-Received: by 2002:a5d:53cf:: with SMTP id a15mr4434605wrw.395.1640348326888; Fri, 24 Dec 2021 04:18:46 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Fri, 24 Dec 2021 12:18:34 +0000 Message-ID: Subject: Re: Code style enforcement To: Tejasvi Singh Cc: "libstdc++" X-Spam-Status: No, score=-0.9 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:18:49 -0000 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 >