This is an archive of the discontinued LLVM Phabricator instance.

Suppress reserved user defined literal warning within namespace std.
Needs ReviewPublic

Authored by EricWF on Jul 20 2016, 9:15 PM.

Details

Reviewers
majnemer
rsmith
Summary

Currently Clang warns if a UDL is defined with a name reserved for future standardization. However this warning can cause problems with the standard library headers. Most of the time the STL headers are treated as system headers and this warning is ignored.

Unfortunately when the STL headers are not treated as system headers this diagnostic issues a dozen or so false positives in *every* TU that includes an STL header. Arguably these diagnostics are false positives because they warn that UDL's in namespace std are supposed to be using the reserved names.

Although rare there are users who effectively use the libc++ headers with -Wsystem-headers (including other LLVM projects). Instead of forcing them to add "-Wno-user-defined-literals" this patch fixes the diagnostic in clang by preventing the emission of false positives.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 64816.Jul 20 2016, 9:15 PM
EricWF retitled this revision from to Suppress reserved user defined literal warning within namespace std..
EricWF updated this object.
EricWF added reviewers: rsmith, majnemer.
EricWF added a subscriber: cfe-commits.
EricWF updated this object.Jul 22 2016, 1:21 PM