]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: fix array-view-selftests.c build with g++ 4.8
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 18 Nov 2021 21:35:34 +0000 (16:35 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 18 Nov 2021 21:35:34 +0000 (16:35 -0500)
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<template<typename ...> 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.

Change-Id: I9c3edd29fb2b190069f0ce0dbf3bc3604d175f48

gdb/unittests/array-view-selftests.c

index fe211a647b54c3e8fe57ffd785a807e08993059b..9df48db391292a2785591edcf82527a100406f98 100644 (file)
@@ -120,7 +120,7 @@ check ()
 /* Check that there's no container->view conversion for containers of derived
    types or subclasses.  */
 
-template<template<typename ...> typename Container>
+template<template<typename ...> class Container>
 static constexpr bool
 check_ctor_from_container ()
 {