aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog2
-rw-r--r--gcc/cp/pt.c1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/conv3.C10
3 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9a30a2fe..8e478d6 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,7 @@
1999-05-19 Mark Mitchell <mark@codesourcery.com>
+ * pt.c (build_template_decl): Copy DECL_NONCONVERTING_P.
+
* decl2.c (start_static_storage_duration_function): Fix comment.
(finish_file): Create static storage duration functions lazily.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 6c316518..338ed81 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1950,6 +1950,7 @@ build_template_decl (decl, parms)
DECL_CLASS_CONTEXT (tmpl) = DECL_CLASS_CONTEXT (decl);
DECL_STATIC_FUNCTION_P (tmpl) = DECL_STATIC_FUNCTION_P (decl);
DECL_CONSTRUCTOR_P (tmpl) = DECL_CONSTRUCTOR_P (decl);
+ DECL_NONCONVERTING_P (tmpl) = DECL_NONCONVERTING_P (decl);
}
return tmpl;
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/conv3.C b/gcc/testsuite/g++.old-deja/g++.pt/conv3.C
new file mode 100644
index 0000000..861b688
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/conv3.C
@@ -0,0 +1,10 @@
+// Build don't link:
+// Origin: Chris Heath <cheath@math.lsa.umich.edu>
+
+struct A {
+ template<typename T> explicit A(T t) {}
+};
+
+void f(A a) {}
+
+int main() {f(1);} // ERROR - no conversion from int to A.