diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/typeck2.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/friend16.C | 16 |
4 files changed, 32 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 20e1f22..cfdaac8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2003-02-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> + + PR c++/9602 + * typeck2.c (abstract_virtuals_error): Don't check when + TYPE is still template parameter dependent. + 2003-02-23 Mark Mitchell <mark@codesourcery.com> PR c++/5333 diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index c7dcb52..5758bf4 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -143,6 +143,11 @@ abstract_virtuals_error (decl, type) CLASSTYPE_PURE_VIRTUALS holds the inline friends. */ return 0; + if (dependent_type_p (type)) + /* For a dependent type, we do not yet know which functions are pure + virtuals. */ + return 0; + u = CLASSTYPE_PURE_VIRTUALS (type); if (decl) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3dad6fd..42df634 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-02-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> + + PR c++/9602 + * g++.dg/template/friend16.C: New test. + 2003-02-23 Mark Mitchell <mark@codesourcery.com> PR c++/5333 diff --git a/gcc/testsuite/g++.dg/template/friend16.C b/gcc/testsuite/g++.dg/template/friend16.C new file mode 100644 index 0000000..3165ed2 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/friend16.C @@ -0,0 +1,16 @@ +// { dg-do compile } + +// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu> + +// PR c++/9602: Inline friend/pure virtual tree data sharing in +// class template. + +template <typename T> struct X { + void foo (X); + friend void bar () {} +}; + +template <typename T> +void X<T>::foo (X x) {} + +template struct X<int>; |