Bug 12117 - ptype can drop const/volatile information
Summary: ptype can drop const/volatile information
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: exp (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 7.6
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-13 17:20 UTC by dje
Modified: 2013-02-06 14:46 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dje 2010-10-13 17:20:33 UTC
Given this testcase:

typedef int my_int;
typedef const my_int const_my_int;
typedef volatile my_int volatile_my_int;
typedef volatile const_my_int volatile_const_my_int;
typedef const volatile_my_int const_volatile_my_int;

my_int v_my_int (0);
const_my_int v_const_my_int (1);
volatile_my_int v_volatile_my_int (2);
const_volatile_my_int v_const_volatile_my_int (3);
volatile_const_my_int v_volatile_const_my_int (4);

int
main ()
{
  return 0;
}

ptype will drop const/volatile information.

(gdb) ptype v_const_my_int
type = int
(gdb) ptype v_volatile_my_int
type = int
(gdb) ptype v_const_volatile_my_int
type = int
Comment 1 Tom Tromey 2013-02-06 14:46:38 UTC
These all work for me with CVS HEAD:

(gdb) ptype v_const_my_int
type = const int
(gdb) ptype v_volatile_my_int
type = volatile int
(gdb) ptype v_const_volatile_my_int
type = const volatile int
(gdb) ptype v_volatile_const_my_int
type = const volatile int


I'm using the Fedora 16 system gcc.
If it still fails for you I would suspect a compiler bug.

I'm closing the bug.