* pt.c (tsubst_friend_class): Check for NULL.
From-SVN: r26688
This commit is contained in:
parent
94ff101fbd
commit
bc639f9058
|
@ -4641,7 +4641,7 @@ tsubst_friend_class (friend_tmpl, args)
|
||||||
|
|
||||||
Here, in the scope of (say) S<int>, `S' is bound to a TYPE_DECL
|
Here, in the scope of (say) S<int>, `S' is bound to a TYPE_DECL
|
||||||
for `S<int>', not the TEMPLATE_DECL. */
|
for `S<int>', not the TEMPLATE_DECL. */
|
||||||
if (!DECL_CLASS_TEMPLATE_P (tmpl))
|
if (!tmpl || !DECL_CLASS_TEMPLATE_P (tmpl))
|
||||||
{
|
{
|
||||||
tmpl = lookup_name (DECL_NAME (friend_tmpl), /*prefer_type=*/1);
|
tmpl = lookup_name (DECL_NAME (friend_tmpl), /*prefer_type=*/1);
|
||||||
tmpl = maybe_get_template_decl_from_type_decl (tmpl);
|
tmpl = maybe_get_template_decl_from_type_decl (tmpl);
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Build don't link:
|
||||||
|
// Origin: Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct S {
|
||||||
|
template <class U>
|
||||||
|
friend struct S2;
|
||||||
|
};
|
||||||
|
|
||||||
|
template struct S<int>;
|
Loading…
Reference in New Issue