* pt.c (tsubst_friend_class): Check for NULL.
From-SVN: r26688
This commit is contained in:
parent
94ff101fbd
commit
bc639f9058
2 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
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 = maybe_get_template_decl_from_type_decl (tmpl);
|
||||
|
|
10
gcc/testsuite/g++.old-deja/g++.pt/friend42.C
Normal file
10
gcc/testsuite/g++.old-deja/g++.pt/friend42.C
Normal file
|
@ -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…
Add table
Reference in a new issue