<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62272>62272</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang rejects out-of-line function definition with concept-auto return type
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
danakj
</td>
</tr>
</table>
<pre>
Clang 16 accepted the code, GCC and MSVC accept the code, but Clang HEAD does not.
https://godbolt.org/z/j67W4EYjo
```cpp
template <class A, class B>
concept Concept = true;
template <class B>
struct IteratorBase {
Concept<B> auto func();
};
template <class B>
Concept<B> auto IteratorBase<B>::func() {}
```
```
<source>:10:34: error: return type of out-of-line definition of 'IteratorBase::func' differs from that in the declaration
Concept<B> auto IteratorBase<B>::func() {}
~~~~~~~~~~~~~~~ ^
<source>:6:21: note: previous declaration is here
Concept<B> auto func();
~~~~~~~~~~~~~~~ ^
1 error generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVEGvmzAM_jXmYrWChEJ74EBpu-2w06RNOwZiSjqaoCS8p7fDfvsUYGr79iZt0qqKBBx__vzZsXBOnTVRAZs9bA6RGH1nbCGFFt8uUW3kS1H1Qp8xyVA0DQ2eJPqOsDGSgFX4rqpQaIkfP32ulhMP9nr0OCO8P5YHlIYcauPXEB8gLudn5_3ggJfATsBOZyNr0_u1sWdgp-_ATpcs_5Iev17MvRNk8fxvhmH-4uk69MITAq-aXjiHZWAwb_fAj_OxxuiJZbWswA_o7UjA9_f4v6PdIJy3Y-PxgycrvLF74QghX9wR8Rc28Co4oRi9wXbUDbAtsN0tUn74h6hvgd5TWAxBSF7eok3M8sMr1d5-5ZUzo21ohkli4CVPgZdI1hobNpb8aDX6l4HQtGhGvzLtqleaUFKrtPLK6GABlj-Su7HKUaq2JeuwteaKvhMelZ7aRlLTCysCyP9L-sfjD2FzfDPfDHjJkpClNj4wxsHSkzKju-eFymFHlpZq_2WpQ1f8kUcy64tn0iEzkutX5YlkweWO70RERZJtWZzGu10SdUUsE0Eb2qV8l9Km3mbJJk2atE7ShlHWZpEqWMx4nLIkTnjGk7WIt5RlJNu4EfmGpZDGdBWqX_f90zVcukg5N1KRMZazqBc19W6aDoxpesbJCIyFYWGL4LOqx7ODNO6V8-6G4pXvaRkeli7UePfQLUGjSc67tnlWvsPlfq4mJe_aLRptX7waFcp3Y71uzBXYKUReltVgTYgI7DTxdcBOUz4_AwAA__96PIHD">