From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17780 invoked by alias); 8 Feb 2013 04:06:56 -0000 Received: (qmail 17459 invoked by uid 48); 8 Feb 2013 04:06:16 -0000 From: "chihin.ko at oracle dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56251] New: no DW_AT_const_value for static const member of a template class Date: Fri, 08 Feb 2013 04:06:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: chihin.ko at oracle dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-02/txt/msg00752.txt.bz2 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 template struct TCC { static const T0 tvalue = 100; }; struct CC { static const int value = 200; }; int main() { CC cc; TCC tcc; printf("tcc.value1 = %u \n", tcc.tvalue); printf("cc.value1 = %u \n", cc.value); }