This is an archive of the discontinued LLVM Phabricator instance.

Provide only one declaration of __throw_runtime_error
AbandonedPublic

Authored by dim on Jun 9 2018, 2:49 PM.

Details

Summary

In rL279903, @hiraditya added a second declaration of
__throw_runtime_error to include/__locale. The original declaration
was in __locale too, but @mclow.lists moved it from there to
stdexcept.

In FreeBSD we compile most things with gcc's -Wredundant-decls, which
warns about such redundant redeclations, so I would like to remove the
one in stdexcept, as all the other callers of the function already
include __locale anyway.

While here, move the declaration in __locale to just above its first
invocation.

Event Timeline

dim created this revision.Jun 9 2018, 2:49 PM

I'm not really happy with gcc's redundant declaration warnings; I think they're "nannying" rather than useful.

That being said, why not just remove the declaration in __locale?
__locale includes string, which includes stdexcept.

Any updates on this one? I like @mclow.lists idea of removing it from __locale.

dim abandoned this revision.Oct 18 2019, 2:50 AM

Obsoleted by D58425 (and rCXX354515).