public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: use decltype instead of typeof in dwarf2/read.c
@ 2022-04-12 18:10 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2022-04-12 18:10 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=30bf8e1ce4498467d62387b0d8a7009e3fbe2ab1

commit 30bf8e1ce4498467d62387b0d8a7009e3fbe2ab1
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Tue Apr 12 12:30:09 2022 -0400

    gdb: use decltype instead of typeof in dwarf2/read.c
    
    When building with -std=c++11, I get:
    
      CXX    dwarf2/read.o
    /home/smarchi/src/binutils-gdb/gdb/dwarf2/read.c: In function ‘void dwarf2_build_psymtabs_hard(dwarf2_per_objfile*)’:
    /home/smarchi/src/binutils-gdb/gdb/dwarf2/read.c:7130:23: error: expected type-specifier before ‘typeof’
     7130 |     using iter_type = typeof (per_bfd->all_comp_units.begin ());
          |                       ^~~~~~
    
    This is because typeof is a GNU extension.  Use C++'s decltype keyword
    instead.
    
    Change-Id: Ieca2e8d25e50f71dc6c615a405a972a54de3ef14

Diff:
---
 gdb/dwarf2/read.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 9e8527a7fc1..7c148aecdf5 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -7127,7 +7127,7 @@ dwarf2_build_psymtabs_hard (dwarf2_per_objfile *per_objfile)
     /* Ensure that complaints are handled correctly.  */
     complaint_interceptor complaint_handler;
 
-    using iter_type = typeof (per_bfd->all_comp_units.begin ());
+    using iter_type = decltype (per_bfd->all_comp_units.begin ());
 
     /* Each thread returns a pair holding a cooked index, and a vector
        of errors that should be printed.  The latter is done because


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-12 18:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12 18:10 [binutils-gdb] gdb: use decltype instead of typeof in dwarf2/read.c Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).