re PR c++/28048 (ICE on accessing member of dependent name)

PR c++/28048
	* semantics.c (check_accessibility_of_qualified_id): Robustify.
	PR c++/28048
	* g++.dg/template/defarg9.C: New test.

From-SVN: r115579
This commit is contained in:
Mark Mitchell 2006-07-19 05:14:25 +00:00 committed by Mark Mitchell
parent cb2eb96f4d
commit fc4297484b
4 changed files with 27 additions and 3 deletions

View File

@ -1,5 +1,8 @@
2006-07-18 Mark Mitchell <mark@codesourcery.com>
PR c++/28048
* semantics.c (check_accessibility_of_qualified_id): Robustify.
PR c++/28235
* pt.c (tsubst_decl): Handling substitutions into a static data
member from within the scope of the tempalte itself.

View File

@ -1506,9 +1506,11 @@ check_accessibility_of_qualified_id (tree decl,
its bases. */
qualifying_type = currently_open_derived_class (scope);
if (qualifying_type && IS_AGGR_TYPE_CODE (TREE_CODE (qualifying_type)))
/* It is possible for qualifying type to be a TEMPLATE_TYPE_PARM
or similar in a default argument value. */
if (qualifying_type
/* It is possible for qualifying type to be a TEMPLATE_TYPE_PARM
or similar in a default argument value. */
&& CLASS_TYPE_P (qualifying_type)
&& !dependent_type_p (qualifying_type))
perform_or_defer_access_check (TYPE_BINFO (qualifying_type), decl);
}

View File

@ -1,5 +1,8 @@
2006-07-18 Mark Mitchell <mark@codesourcery.com>
PR c++/28048
* g++.dg/template/defarg9.C: New test.
PR c++/28235
* g++.dg/template/static27.C: New test.

View File

@ -0,0 +1,16 @@
// PR c++/28048
template<typename T> struct Boom;
template<typename T, bool D = Boom<T>::Internal::Value> // <--ICE
struct Foo
{
};
template<typename T> struct Boom
{
struct Internal
{
static const bool Value = false;
};
};