function templates can use it as a return type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182433
91177308-0d34-0410-b5e6-
96231b3b80d8
return true;
}
+ // If this type hasn't been deduced yet, then conservatively assume that
+ // it'll work out to be a literal type.
+ if (isa<AutoType>(BaseTy->getCanonicalTypeInternal()))
+ return true;
+
return false;
}
static_assert(test_copy("hello world", 10), "");
static_assert(test_copy("hello world", 10), "");
}
+
+namespace deduced_return_type {
+ constexpr auto f() { return 0; }
+ template<typename T> constexpr auto g(T t) { return t; }
+ static_assert(f() == 0, "");
+ static_assert(g(true), "");
+}