new file mode 100644
@@ -0,0 +1,8 @@
+// PR c++/89356
+// { dg-do compile { target c++11 } }
+
+template<typename T>
+auto fn () -> decltype(unsigned{2u} + (T)3) { return 42; }
+
+// { dg-final { scan-assembler "_Z2fnIiEDTpltljLj2EEcvT_Li3EEv" } }
+template auto fn<int>() -> decltype(unsigned{2u} + (int)3);
new file mode 100644
@@ -0,0 +1,10 @@
+// PR c++/89356
+// { dg-do compile { target c++11 } }
+
+typedef unsigned a;
+template <typename> struct h {};
+template <int, class b> auto c(b f) -> h<decltype(f(a{0}))>;
+typedef char byte;
+enum d : byte;
+d g(byte);
+h<d> e = c<6>(g);