================
@@ -147,6 +147,41 @@ void f(T t) {
template void f<X>(X);
}
+namespace DependentTypenameReturnType {
+ // Success case
+ template <class T> struct S { typedef int type; };
+ template <class T> void f() {
+ auto b = ^ typename S<T>::type () { return 0; };
+ (void)b;
+ }
+ template void f<int>();
+
+ // Same as 'f' but with no parameter list. The written block signature is
+ // then stored as just the return-type loc (there is no FunctionProtoTypeLoc
+ // to look through).
+ template <class T> void g() {
+ auto b = ^ typename S<T>::type { return 0; };
+ (void)b;
+ }
+ template void g<int>();
+
+ // A block with no explicit return type has no return-type source location,
so
+ // it takes the deduced-return fallback in TransformBlockExpr.
+ template <class T> T h() {
+ auto b = ^ { T x{}; return x; };
+ return b();
+ }
+ template int h<int>();
----------------
hnrklssn wrote:
thanks, added
https://github.com/llvm/llvm-project/pull/226431
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits