https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97399
Bug ID: 97399
Summary: g++ 9.3 cannot compile SFINAE code with separated
declaration and definition, g++ 7.3 compiles
Product: gcc
Version: 9.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: renlin at gcc dot gnu.org
Target Milestone: ---
Created attachment 49362
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49362&action=edit
test case 1
For gcc_1.c++
gcc 7.3 compiles for this code
clang 7 compiles for this code
gcc 9.3 fails to compile with following message
Not sure if this is gcc's issue or clang.
```
:29:16: error: no declaration matches 'constexpr
enable_if_t<((tmp*)this)->is_integral(), bool> tmp::func(E, E) const'
29 | constexpr auto tmp::func(E f_lhs, E f_rhs)
|^~~
:18:27: note: candidate is: 'template static constexpr
enable_if_t<((tmp*)this)->is_integral(), bool> tmp::func(E, E)'
18 | static constexpr auto func(E f_lhs, E f_rhs)
| ^~~~
:12:8: note: 'struct tmp' defined here
12 | struct tmp
```
Meanwhile for gcc_2.c++
gcc compiles without any issue.
clang gives the following error message
```
:27:28: error: template parameter redefines default argument
template (), bool>>
^
:17:32: note: previous default template argument defined here
template (), bool>>
```
It seems this is not an new issue, and might be duplicated.