[Bug c/69415] -Wmisleading-indentation warns on "if (__b < __a) return __b; return __a;"
dmalcolm at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 21 16:50:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69415
--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Looking at our own repo:
The initial commit of
libstdc++-v3/include/bits/stl_algobase.h
in r36723 (aka 1d487acac02f71846ad17cadad3e4cb1cca9f799)
on 2000-10-05 had e.g.:
+template <class _Tp, class _Compare>
+inline const _Tp& min(const _Tp& __a, const _Tp& __b, _Compare __comp) {
+ //return __comp(__b, __a) ? __b : __a;
+ if (__comp(__b, __a)) return __b; return __a;
+}
which seems to have become:
+ template<typename _Tp, typename _Compare>
+ inline const _Tp&
+ min(const _Tp& __a, const _Tp& __b, _Compare __comp)
+ {
+ //return __comp(__b, __a) ? __b : __a;
+ if (__comp(__b, __a)) return __b; return __a;
+ }
in r44117 (aka 66b2d994212c112af20939f98add003bc2fba023)
on 2001-07-17
The construct was removed in r77050 (aka
754b69003887aee5908c79b054446b5159b17d22):
2004-01-31 Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_algo.h: Wrap overlong lines, constify
a few variables, reformat according to the coding standards.
* include/bits/stl_algobase.h: Likewise.
* include/bits/stl_heap.h: Likewise.
which had e.g.:
@@ -184,7 +194,9 @@ namespace std
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
{
//return __comp(__b, __a) ? __b : __a;
- if (__comp(__b, __a)) return __b; return __a;
+ if (__comp(__b, __a))
+ return __b;
+ return __a;
}
More information about the Gcc-bugs
mailing list