gcc/cp/
2009-07-06 Simon Martin <simartin@users.sourceforge.net>
PR c++/40557
* pt.c (perform_typedefs_access_check, get_types_needing_access_check,
append_type_to_template_for_access_check_1): Use
RECORD_OR_UNION_CODE_P.
gcc/testsuite/
2009-07-06 Simon Martin <simartin@users.sourceforge.net>
PR c++/40557
* g++.dg/template/union2.C: New test.
From-SVN: r149276
+2009-07-06 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/40557
+ * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
+ append_type_to_template_for_access_check_1): Use
+ RECORD_OR_UNION_CODE_P.
+
2009-07-04 Jason Merrill <jason@redhat.com>
* pt.c (retrieve_specialization): Don't get confused by a
tree t;
if (!tmpl
- || (TREE_CODE (tmpl) != RECORD_TYPE
+ || (!RECORD_OR_UNION_CODE_P (TREE_CODE (tmpl))
&& TREE_CODE (tmpl) != FUNCTION_DECL))
return;
if (!(ti = get_template_info (t)))
return NULL_TREE;
- if (TREE_CODE (t) == RECORD_TYPE || TREE_CODE (t) == FUNCTION_DECL)
+ if (RECORD_OR_UNION_CODE_P (TREE_CODE (t))
+ || TREE_CODE (t) == FUNCTION_DECL)
{
if (!TI_TEMPLATE (ti))
return NULL_TREE;
return;
gcc_assert ((TREE_CODE (t) == FUNCTION_DECL
- || TREE_CODE (t) == RECORD_TYPE)
+ || RECORD_OR_UNION_CODE_P (TREE_CODE (t)))
&& type_decl
&& TREE_CODE (type_decl) == TYPE_DECL
&& scope);
+2009-07-06 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/40557
+ * g++.dg/template/union2.C: New test.
+
2009-07-04 Jason Merrill <jason@redhat.com>
* g++.dg/template/using15.C: New.
--- /dev/null
+/* PR c++/40557 */
+/* { dg-do "compile" } */
+
+struct A
+{
+ typedef int X;
+};
+
+template<int> union B
+{
+ A::X x;
+};