Skip to content

Commit d95da99

Browse files
committed
Fix the build with gcc when -Wredundant-decls is passed
Summary: gcc warns that `__throw_runtime_error` is declared both in `<__locale>` and `<stdexcept>`, if `-Wredundant-decls` is passed on the command line; this is the case with FreeBSD when ${WARNS} == 6. Since `<__locale>` gets its first declaration via a transitive include of `<stdexcept>`, and the second declaration is after the first invocation of `__throw_runtime_error`, delete that second declaration. Signed-off-by: Enji Cooper <[email protected]> Reviewers: kristina, MaskRay, EricWF, ldionne, ngie Reviewed By: EricWF Subscribers: krytarowski, brooks, emaste, dim, christof, jdoerfert, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D58425 llvm-svn: 354515
1 parent 8d9c224 commit d95da99

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

libcxx/include/__locale

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,8 +1229,6 @@ _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<w
12291229
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>)
12301230
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>)
12311231

1232-
_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*);
1233-
12341232
template <size_t _Np>
12351233
struct __narrow_to_utf8
12361234
{

0 commit comments

Comments
 (0)