From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (vps-42846194.vps.ovh.net [IPv6:2001:41d0:801:2000::2400]) by sourceware.org (Postfix) with ESMTPS id D69013858422 for ; Thu, 18 Nov 2021 21:11:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D69013858422 Received: from ubuntu.lan (unknown [IPv6:2a02:390:9086::635]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 7D7B384624; Thu, 18 Nov 2021 21:11:41 +0000 (UTC) Date: Thu, 18 Nov 2021 21:11:32 +0000 From: Lancelot SIX To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 2/2] gdb: fix array-view-selftests.c build with g++ 4.8 Message-ID: <20211118211132.sobuijcdi74wm4i7@ubuntu.lan> References: <20211118205053.2429353-1-simon.marchi@efficios.com> <20211118205053.2429353-2-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211118205053.2429353-2-simon.marchi@efficios.com> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Thu, 18 Nov 2021 21:11:41 +0000 (UTC) X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2021 21:11:44 -0000 On Thu, Nov 18, 2021 at 03:50:53PM -0500, Simon Marchi via Gdb-patches wrote: > When building with g++ 4.8, I get: > > CXX unittests/array-view-selftests.o > /home/smarchi/src/binutils-gdb/gdb/unittests/array-view-selftests.c:123:42: error: expected 'class' before 'Container' > template typename Container> > ^ > > I am no C++ template expert, but it looks like if I change "typename" for > "class", as the compiler kind of suggests, the code compiles. Indeed. Apparently 'typename' can be used instead of 'class' in a template template parameter only starting c++17[1]. Thanks for taking care of this. Lancelot. [1] https://en.cppreference.com/w/cpp/language/template_parameters#Template_template_parameter q> > Change-Id: I9c3edd29fb2b190069f0ce0dbf3bc3604d175f48 > --- > gdb/unittests/array-view-selftests.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdb/unittests/array-view-selftests.c b/gdb/unittests/array-view-selftests.c > index fe211a647b5..9df48db3912 100644 > --- a/gdb/unittests/array-view-selftests.c > +++ b/gdb/unittests/array-view-selftests.c > @@ -120,7 +120,7 @@ check () > /* Check that there's no container->view conversion for containers of derived > types or subclasses. */ > > -template typename Container> > +template class Container> > static constexpr bool > check_ctor_from_container () > { > -- > 2.33.1 >