From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2303 invoked by alias); 28 Jun 2014 10:17:59 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 2276 invoked by uid 48); 28 Jun 2014 10:17:59 -0000 From: "Marc.van-Leeuwen at math dot univ-poitiers.fr" To: gdb-prs@sourceware.org Subject: [Bug c++/17098] New: In program using unique_ptr, identifier 'tuple' cannot be used (problem with variadic templates?) Date: Sat, 28 Jun 2014 10:17:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: Marc.van-Leeuwen at math dot univ-poitiers.fr X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q2/txt/msg00512.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17098 Bug ID: 17098 Summary: In program using unique_ptr, identifier 'tuple' cannot be used (problem with variadic templates?) Product: gdb Version: unknown Status: NEW Severity: normal Priority: P2 Component: c++ Assignee: unassigned at sourceware dot org Reporter: Marc.van-Leeuwen at math dot univ-poitiers.fr Created attachment 7662 --> https://sourceware.org/bugzilla/attachment.cgi?id=7662&action=edit preprocessed input from sample program, file mini.ii When running gdb on a program using an instance of the unique_ptr class template, the identifier 'tuple' can no longer be accessed in any way, as otherwise valid expressions now give a syntax error. A minimal example: mini.cpp: #include int main() { std::unique_ptr p; } compile this with gcc (version 4.8.1) using the command g++ -std=c++11 -ggdb -o mini mini.cpp now run gdb and ask to print the (nonexistent) variable 'tuple' $ gdb mini GNU gdb (GDB) 7.6.1-ubuntu Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /home/marc/atlas/sources/stand-alone/mini...done. (gdb) p tuple A syntax error in expression, near `'. (gdb) Whereas in a program not using any unique_ptr (for instance the above program after removing the unique statement in 'main') one would correctly get (gdb) p tuple No symbol "tuple" in current context. It seems that 'tuple' has changed its syntax category for gdb, making any access to variables/fields called 'tuple' impossible. I stumbled on this when debugging a program that actually used a field of that name, but the bug does not appear to depend on that circumstance. Looking and the (attached) preprocessed input, it seems that the problem might be that 'tuple' is defined as a variadic template class: template class tuple; and later template class tuple : public _Tuple_impl<0, _Elements...> { ... }; -- You are receiving this mail because: You are on the CC list for the bug.