public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56251] New: no DW_AT_const_value  for static const member of a template class
@ 2013-02-08  4:06 chihin.ko at oracle dot com
  2013-02-08  4:09 ` [Bug c++/56251] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: chihin.ko at oracle dot com @ 2013-02-08  4:06 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56251

             Bug #: 56251
           Summary: no DW_AT_const_value  for static const member of a
                    template class
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: chihin.ko@oracle.com


If a static const member is in template class, there is no DW_AT_const_value
info,
compare these tvalue/value


< 2><0x0000005a>      DW_TAG_member
                        DW_AT_name                  "value"
                        DW_AT_decl_file             0x00000001 t.cc
                        DW_AT_decl_line             0x00000009
                        DW_AT_type                  <0x00000069>
                        DW_AT_external              yes(1)
                        DW_AT_declaration           yes(1)
                        DW_AT_const_value           200(as signed = -56)  <===
const value
< 1><0x00000069>    DW_TAG_const_type
                      DW_AT_type                  <0x0000002c>

---------------------------------------------------------------------------------

< 2><0x0000007a>      DW_TAG_member
                        DW_AT_name                  "tvalue"
                        DW_AT_decl_file             0x00000001 t.cc
                        DW_AT_decl_line             0x00000005
                        DW_AT_type                  <0x00000069>
                        DW_AT_external              yes(1)
                        DW_AT_declaration           yes(1)
                                                                    <==== no
const value
< 2><0x00000087>      DW_TAG_template_type_parameter
                        DW_AT_name                  "T0"


cat t.cc

#include <stdio.h>

template<class T0, class T1>
struct TCC {
        static const T0 tvalue = 100;
};

struct CC {
        static const int value = 200;
};

int main()
{
    CC cc;
    TCC<int, int> tcc;

        printf("tcc.value1 = %u \n", tcc.tvalue);
        printf("cc.value1 = %u \n", cc.value);
}


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-02-10 16:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-08  4:06 [Bug c++/56251] New: no DW_AT_const_value for static const member of a template class chihin.ko at oracle dot com
2013-02-08  4:09 ` [Bug c++/56251] " pinskia at gcc dot gnu.org
2013-02-08 21:25 ` chihin.ko at oracle dot com
2013-02-08 21:29 ` pinskia at gcc dot gnu.org
2013-02-08 22:02 ` chihin.ko at oracle dot com
2013-02-08 22:10 ` pinskia at gcc dot gnu.org
2013-02-08 22:51 ` paolo.carlini at oracle dot com
2013-02-10 16:00 ` daniel.kruegler at googlemail dot com

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).