mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-06 22:20:21 +08:00
re PR c++/15701 (ICE with friends and template template parameter)
PR c++/15701 * friend.c (add_friend): Do not try to perform access checks for functions from dependent classes. PR c++/15701 * g++.dg/template/friend29.C: New test. From-SVN: r82516
This commit is contained in:
parent
5847e53ee7
commit
e17b3578a3
@ -1,3 +1,9 @@
|
||||
2004-05-31 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/15701
|
||||
* friend.c (add_friend): Do not try to perform access checks for
|
||||
functions from dependent classes.
|
||||
|
||||
2004-05-31 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
||||
* cxx-pretty-print.c (pp_cxx_colon_colon): Expor.
|
||||
|
@ -164,7 +164,11 @@ add_friend (tree type, tree decl, bool complain)
|
||||
}
|
||||
|
||||
if (DECL_CLASS_SCOPE_P (decl))
|
||||
perform_or_defer_access_check (TYPE_BINFO (DECL_CONTEXT (decl)), decl);
|
||||
{
|
||||
tree class_binfo = TYPE_BINFO (DECL_CONTEXT (decl));
|
||||
if (!uses_template_parms (BINFO_TYPE (class_binfo)))
|
||||
perform_or_defer_access_check (class_binfo, decl);
|
||||
}
|
||||
|
||||
maybe_add_class_template_decl_list (type, decl, /*friend_p=*/1);
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
2004-05-31 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/15701
|
||||
* g++.dg/template/friend29.C: New test.
|
||||
|
||||
2004-05-31 Joseph S. Myers <jsm@polyomino.org.uk>
|
||||
|
||||
PR c/15749
|
||||
|
11
gcc/testsuite/g++.dg/template/friend29.C
Normal file
11
gcc/testsuite/g++.dg/template/friend29.C
Normal file
@ -0,0 +1,11 @@
|
||||
// PR c++/15701
|
||||
|
||||
template<template<int> class T> struct A : T<0>
|
||||
{
|
||||
void foo();
|
||||
template<template<int> class U> friend void A<U>::foo();
|
||||
};
|
||||
|
||||
template<int> struct B {};
|
||||
|
||||
A<B> a;
|
Loading…
Reference in New Issue
Block a user