diff --git a/gcc/cp/cvt.cc b/gcc/cp/cvt.cc
index b1176317d99..571f2e64d03 100644
--- a/gcc/cp/cvt.cc
+++ b/gcc/cp/cvt.cc
@@ -985,7 +985,9 @@ ocp_convert (tree type, tree expr, int convtype, int flags,
 					    type, flags, complain);
 	}
       if (ctor)
-	return build_cplus_new (type, ctor, complain);
+	return (processing_template_decl
+		? ctor
+		: build_cplus_new (type, ctor, complain));
     }
 
   if (complain & tf_error)
diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ89.C b/gcc/testsuite/g++.dg/cpp1y/var-templ89.C
new file mode 100644
index 00000000000..5f98a95580c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/var-templ89.C
@@ -0,0 +1,32 @@
+// PR c++/125539
+// { dg-do compile { target c++14 } }
+
+struct A {};
+struct B { int i; };
+constexpr void foo () {}
+
+template<typename T>
+constexpr static A a1 = (foo (), A {});
+template<typename T>
+constexpr static A a2 = (A{}, A{});
+template<typename T>
+constexpr static A a3 = A{};
+template<typename T>
+constexpr static A a4 = {};
+template<typename T>
+constexpr static A a5{};
+template<typename T>
+constexpr static A a6 = (A{}, A{}, A{}, A{}, A{}, A{}, A{});
+template<int N>
+constexpr static B b1 = B{N};
+template<int N>
+constexpr static B b2 = (B{N}, B{N});
+
+template const A a1<int>;
+template const A a2<int>;
+template const A a3<int>;
+template const A a4<int>;
+template const A a5<int>;
+template const A a6<int>;
+template const B b1<42>;
+template const B b2<42>;
