This is an archive of the discontinued LLVM Phabricator instance.

Fix unused private field warning in stdexcept after r207695
ClosedPublic

Authored by dim on Jan 4 2015, 7:24 AM.

Details

Summary

As I mentioned on IRC, r207695 leads to a warning when compiling <stdexcept> (or any other header that includes it), if you use -Wsystem-headers, like we do in FreeBSD:

In file included from test-stdexcept.cpp:1:
In file included from include/array:109:
include/stdexcept:56:17: warning: private field '__imp_' is not used [-Wunused-private-field]
    const char *__imp_;
                ^
1 warning generated.

Apart from just including <refstring> in stdexcept, which is apparently too costly, the fix with lowest impact would probably be to add attribute((unused)) to the imp_ field.

However, there isn't any _LIBCPP_UNUSED define in __config yet, so that would have to be added, like in this proposed change.

Somebody who knows about Microsoft C++ and IBM C++ should fill in the unused attribute syntax appropriate for those compilers, if there is any.

Diff Detail

Repository
rL LLVM

Event Timeline

dim updated this revision to Diff 17776.Jan 4 2015, 7:24 AM
dim retitled this revision from to Fix unused private field warning in stdexcept after r207695.
dim updated this object.
dim edited the test plan for this revision. (Show Details)
dim added reviewers: joerg, mclow.lists.
dim added a subscriber: Unknown Object (MLST).
dim updated this object.Jan 4 2015, 7:25 AM
emaste added a subscriber: emaste.Jan 6 2015, 2:44 PM
joerg accepted this revision.Jan 16 2015, 6:28 AM
joerg edited edge metadata.
This revision is now accepted and ready to land.Jan 16 2015, 6:28 AM
dim added a comment.Jan 23 2015, 12:24 PM

Marshall? Are you OK with this? :)

EricWF accepted this revision.Feb 4 2015, 1:13 PM
EricWF added a reviewer: EricWF.
EricWF added a subscriber: EricWF.

LGTM as well. You can commit this. I'll let Marshall know.

mclow.lists accepted this revision.Feb 4 2015, 1:24 PM
mclow.lists edited edge metadata.
This revision was automatically updated to reflect the committed changes.