================ @@ -640,3 +640,36 @@ namespace PR46637 { template<typename T> struct Y { T x; }; Y<auto() -> auto> y; // expected-error {{'auto' not allowed in template argument}} } + +namespace GH71015 { + +// Check that there is no error in case a templated function is recursive and +// has a placeholder return type. +struct Node { + int value; + Node* left; + Node* right; +}; + +bool parse(const char*); +Node* parsePrimaryExpr(); + +auto parseMulExpr(auto node) { // cxx14-error {{'auto' not allowed in function prototype}} + if (node == nullptr) node = parsePrimaryExpr(); + if (!parse("*")) return node; + return parseMulExpr(new Node{.left = node, .right = parsePrimaryExpr()}); ---------------- zygoloid wrote:
It would be great to add a test that this is rejected without the previous line `retuen node;` https://github.com/llvm/llvm-project/pull/75456 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits