[Bug c++/85011] GCC complains that 2 identical function prototypes are different

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 21 08:52:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85011

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|diagnostic                  |rejects-valid

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
clang says

t.C:5:33: error: return type of out-of-line definition of 'foo::f1' differs
from
      that in the declaration
template <class T> auto foo<T>::f1() -> decltype ((this)->foo<T>::x) {}
                                ^
t.C:3:8: note: previous declaration is here
                auto f1() -> decltype(x);
                     ^
1 error generated.

so I'm not sure the standard says they are the same


More information about the Gcc-bugs mailing list