gcc/ChangeLog:
PR debug/40705
PR c++/403057
* dwarf2.out.c (gen_type_die_with_usage): Added comment.
gcc/cp/ChangeLog:
PR debug/40705
PR c++/403057
* decl2.c (grokfield): Don't call set_underlying_type on typedef
decls that are type names.
gcc/testsuite/ChangeLog:
PR debug/40705
PR c++/403057
* g++.dg/debug/dwarf2/typedef1.C: New test.
* g++.dg/other/typedef3.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149628
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-07-14 Dodji Seketeli <dodji@redhat.com>
+
+ PR debug/40705
+ PR c++/403057
+ * dwarf2.out.c (gen_type_die_with_usage): Added comment.
+
2009-07-14 Richard Guenther <rguenther@suse.de>
PR middle-end/40745
+2009-07-14 Dodji Seketeli <dodji@redhat.com>
+
+ PR debug/40705
+ PR c++/403057
+ * decl2.c (grokfield): Don't call set_underlying_type on typedef
+ decls that are type names.
+
2009-07-13 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C++/22154
cplus_decl_attributes (&value, attrlist, attrflags);
}
- if (declspecs->specs[(int)ds_typedef])
+ if (declspecs->specs[(int)ds_typedef]
+ && TREE_TYPE (value) != error_mark_node
+ && TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value))) != value)
set_underlying_type (value);
return value;
if (type == NULL_TREE || type == error_mark_node)
return;
+ /* If TYPE is a typedef type variant, let's generate debug info
+ for the parent typedef which TYPE is a type of. */
if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
&& DECL_ORIGINAL_TYPE (TYPE_NAME (type)))
{
+2009-07-14 Dodji Seketeli <dodji@redhat.com>
+
+ PR debug/40705
+ * g++.dg/debug/dwarf2/typedef1.C: New test.
+
+ PR c++/403057
+ * g++.dg/other/typedef3.C: New test.
+
2009-07-14 Maxim Kuvyrkov <maxim@codesourcery.com>
* gcc.dg/20090709-1.c: Move to a proper place ...
--- /dev/null
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin: PR c++/40705
+// { dg-options "-g -dA" }
+// { dg-do compile }
+// { dg-final { scan-assembler-times "DW_TAG_structure_type" 2 } }
+// { dg-final { scan-assembler-times "DW_AT_name: \"foo<1u>\"" 1 } }
+// { dg-final { scan-assembler-times "DW_TAG_enumeration_type" 2 } }
+// { dg-final { scan-assembler-times "DW_AT_name: \"typedef foo<1u>::type type\"" 1 } }
+// { dg-final { scan-assembler-times "DIE (.*) DW_TAG_enumeration_type" 2 } }
+// { dg-final { scan-assembler-times "\"e0..\".*DW_AT_name" 1 } }
+// { dg-final { scan-assembler-times "\"e1..\".*DW_AT_name" 1 } }
+
+template <unsigned int n>
+struct foo
+{
+public:
+ typedef
+ unsigned char type;
+};
+
+template<>
+struct foo<1>
+{
+ typedef enum { e0, e1 } type;
+};
+
+int
+main()
+{
+ foo<1> f;
+ foo<1>::type t = foo<1>::e1;
+ return t;
+}
--- /dev/null
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin: PR c++/40357
+// { dg-do compile }
+
+struct XalanCProcessor
+{
+ typedef enum {eInvalid, eXalanSourceTree, eXercesDOM} ParseOptionType;
+ ParseOptionType getParseOption(void);
+};
+typedef XalanCProcessor::ParseOptionType ParseOptionType;
+ParseOptionType XalanCProcessor::getParseOption(void) {}
+