gcc/cp/ChangeLog:
PR c++/41863
* pt.c (iterative_hash_template_arg): articifial parms
don't have DECL_PARM_INDEX set. Do not hash it.
gcc/testsuite/ChangeLog:
PR c++/41863
* g++.dg/template/sizeof12.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153735
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-10-30 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/41863
+ * pt.c (iterative_hash_template_arg): articifial parms
+ don't have DECL_PARM_INDEX set. Do not hash it.
+
2009-10-28 Jerry Quinn <jlquinn@optonline.net>
* mangle.c (mangle_type_string_for_rtti): Revert r149964.
}
case PARM_DECL:
- val = iterative_hash_object (DECL_PARM_INDEX (arg), val);
+ if (!DECL_ARTIFICIAL (arg))
+ val = iterative_hash_object (DECL_PARM_INDEX (arg), val);
return iterative_hash_template_arg (TREE_TYPE (arg), val);
case TARGET_EXPR:
+2009-10-30 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/41863
+ * g++.dg/template/sizeof12.C: New test.
+
2009-10-29 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/pack14.adb: New test.
--- /dev/null
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR c++/41863
+
+template<int X>
+struct Bar
+{
+};
+
+template<typename T>
+class Foo
+{
+ T m_foo;
+
+ void
+ crash()
+ {
+ Bar<sizeof(m_foo)> bar;
+ }
+};