* pt.c (build_template_decl): Copy DECL_NONCONVERTING_P.
authorMark Mitchell <mark@codesourcery.com>
Wed, 19 May 1999 20:01:04 +0000 (20:01 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Wed, 19 May 1999 20:01:04 +0000 (20:01 +0000)
From-SVN: r27034

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/g++.old-deja/g++.pt/conv3.C [new file with mode: 0644]

index 9a30a2f..8e478d6 100644 (file)
@@ -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.
 
index 6c31651..338ed81 100644 (file)
@@ -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 (file)
index 0000000..861b688
--- /dev/null
@@ -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.