<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60538>60538</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang] -fdelayed-template-parsing not compatiple with MSVC /Zc:twoPhase-
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bgnx
</td>
</tr>
</table>
<pre>
I have some code which uses non-two-phase lookup MSVC feature (but super convenient because you don't have to write forward declaration of every function you defined later in source code)
```
auto func(auto val){
return func2(val);
};
auto func2(auto val){
return func3(val);
};
auto func3(auto val){
return val;
};
int main(){
return func(123);
}
```
This code compiles fine with "/Zc:twoPhase- /std:c++20" flags in MSVC ([godbolt](https://godbolt.org/z/39WbPEors)) but failed to compile in Clang with "-fdelayed-template-parsing -std=c++20" flags [godbolt](https://godbolt.org/z/sj11jdK69)
I think we should make "-fdelayed-template-parsing" flag to work like MSVC "/Zc:twoPhase" flag
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUlN-K6zYQxp9mfDNkscdxEl_4YnNSw6EUDrS00DtZGsfaKJLRn6Tbpy_WevfAdrucQohlafTNTzOfJULQZ8vcQXOE5lSIFCfnu-Fs_yoGp567rziJG2NwV0bpFON90nLCFDigdXYT724zTyIwGucuacZffv39C44sYvKMQIchRQxpZo_S2RtbzTbiwFKkwPjsEipngfbxJU90ePc6Mo7O34VXqFga4UXUzqIbkW_sn3FMVuaZvJ9HbVmhEZE9aovBJS9faIFaKE9QPsKuXH_5VaTosgrQIY9vwiyx--PLOiKi55i8zVEEdFgj6jUC9qe38Zsa_Zhc_YNy9X_JrVrL9EcC2ka8Cm2BDp9QAB0qqt9DfFSt3yYdXpov3XXWhgMuJce7jhMCEVD_p4T6Md7dt8UKGwTqQ1RQP0qgI9CRSiDC0YhzWDqUPbLQNcezU4MzEZoT0GGKcQ5QPwL1QP269OD8Gaj_G6iv2z-Gbz85HxZqanHx1ii0YbUYZ4VbEnwxwp7f-DajYiOeWW0iX-fFJ5tZ-KDtGTcZ8_QB5v9lC09V9aR-3rXfPZf_v2KctL3gnTFMLhmFV3Hhz7FeKfLn4PwFjb7wa9X-Ve7X6EJ1tWrrVhTcVbt9syu35b4spm4ULJpWyYoHbmRbkmyqtm137bbcjw3LQndUUl1S2VR1va3LB1ltm4qk5Krat7UaYFvyVWjzYMztuhy60CEk7nZlUx8KIwY2IV8hRJbvmBcX0uZU-G7ZsxnSOcC2NDrE8F0l6mjy3ZMbBs0JP-mVdTH3WEQ9m9V9a03e-a9I3nTvGqbjlIYH6a5A_ZJ_fWxm755YRqA-UwegPp_qnwAAAP__AkuVog">