summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-23 23:16:12 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-23 23:16:12 +0000
commit528bbcf57fc991715878b21d3cf54a2e6c516aca (patch)
tree4d6deeac6ab0b6a84bdfddfe269fa7b3a8581bba /gcc
parent3ebfd19c6f829cd0d73a7c666174c0be379ab7a0 (diff)
downloadppe42-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/ChangeLog5
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/template/sfinae3.C17
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);
OpenPOWER on IntegriCloud