diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-16 09:05:17 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-16 09:05:17 +0000 |
commit | a86a1d8bc148960f6534efd6f4920551ada443b6 (patch) | |
tree | 9d4f15c1c05b834e3499da0b28b17620b4fc27ec | |
parent | 22355cffa1412b8049ac9cf4581f4ca4a211d364 (diff) | |
download | gcc-a86a1d8bc148960f6534efd6f4920551ada443b6.tar.gz |
/cp
2007-08-16 Paolo Carlini <pcarlini@suse.de>
PR c++/31132
* pt.c (tsubst_friend_function): When check_classfn
returns error_mark_node likewise return it.
/testsuite
2007-08-16 Paolo Carlini <pcarlini@suse.de>
PR c++/31132
* g++.dg/template/crash69.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127535 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/crash69.C | 12 |
4 files changed, 24 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6a7a4a41dfd..6e7bd964f11 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-16 Paolo Carlini <pcarlini@suse.de> + + PR c++/31132 + * pt.c (tsubst_friend_function): When check_classfn + returns error_mark_node likewise return it. + 2007-08-15 Jakub Jelinek <jakub@redhat.com> PR c++/32992 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f414bc3521f..68cd9a580a2 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -6289,7 +6289,7 @@ tsubst_friend_function (tree decl, tree args) tree fn = check_classfn (context, new_friend, NULL_TREE); - if (fn && fn != error_mark_node) + if (fn) new_friend = fn; } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5126a69c5bf..14e58c9b42a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-08-16 Paolo Carlini <pcarlini@suse.de> + + PR c++/31132 + * g++.dg/template/crash69.C: New. + 2007-08-15 Daniel Jacobowitz <dan@codesourcery.com> * lib/target-supports.exp (check_effective_target_arm32): Use diff --git a/gcc/testsuite/g++.dg/template/crash69.C b/gcc/testsuite/g++.dg/template/crash69.C new file mode 100644 index 00000000000..957f1e19ba3 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash69.C @@ -0,0 +1,12 @@ +// PR c++/31132 + +template<typename T> class A +{ + static int i; // { dg-error "is private" } + friend int T::foo(); // { dg-error "does not match" } +}; + +struct B +{ + void foo() { A<B>::i; } // { dg-error "within|candidate" } +}; |