diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-23 23:16:12 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-23 23:16:12 +0000 |
commit | 528bbcf57fc991715878b21d3cf54a2e6c516aca (patch) | |
tree | 4d6deeac6ab0b6a84bdfddfe269fa7b3a8581bba /gcc | |
parent | 3ebfd19c6f829cd0d73a7c666174c0be379ab7a0 (diff) | |
download | ppe42-gcc-528bbcf57fc991715878b21d3cf54a2e6c516aca.tar.gz ppe42-gcc-528bbcf57fc991715878b21d3cf54a2e6c516aca.zip |
PR c++/24671
* pt.c (instantiate_template): Handle SFINAE.
PR c++/24671
* g++.dg/template/sfinae3.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109022 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/sfinae3.C | 17 |
4 files changed, 29 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6a6090a8af8..1279a44ebb6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2005-12-23 Mark Mitchell <mark@codesourcery.com> + + PR c++/24671 + * pt.c (instantiate_template): Handle SFINAE. + 2005-12-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de> * decl.c (grokdeclarator): Improve diagnostic for friend diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 93dad098689..5b025ce7ff4 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -9149,6 +9149,8 @@ instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain) /* Substitute template parameters. */ fndecl = tsubst (DECL_TEMPLATE_RESULT (gen_tmpl), targ_ptr, complain, gen_tmpl); + if (fndecl == error_mark_node) + return error_mark_node; /* Now we know the specialization, compute access previously deferred. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3265ba5168c..fd0d3336607 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-12-23 Mark Mitchell <mark@codesourcery.com> + + PR c++/24671 + * g++.dg/template/sfinae3.C: New test. + 2005-12-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de> * g++.dg/other/friend4.C: New test. diff --git a/gcc/testsuite/g++.dg/template/sfinae3.C b/gcc/testsuite/g++.dg/template/sfinae3.C new file mode 100644 index 00000000000..8d141ea0ad1 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae3.C @@ -0,0 +1,17 @@ +// PR c++/24671 +// { dg-options "" } + +template<typename> struct A +{ + typedef int X; + static const int i = 0; +}; + +template<typename> struct B +{ + B(const B&); // { dg-error "candidate" } + typedef typename A<char[A<B>::i]>::X Y; + template<typename T> B(T, Y); // { dg-error "call" } +}; + +B<int> b(0,0); |