[cfe-commits] [Patch] -Wignored-qualifiers should point to the first ignored qualifier
Hans Wennborg
hans at chromium.org
Thu Jun 2 02:08:39 PDT 2011
On Wed, Jun 1, 2011 at 9:20 PM, Douglas Gregor <dgregor at apple.com> wrote:
> This is looking really good. The only issue I see is when comparing source locations with <, e.g.,
>
> + if (!Loc.isValid() || ConstQualLoc < Loc)
> + Loc = ConstQualLoc;
>
> The < operator on SourceLocation doesn't necessarily mean "before in the translation"; it's a somewhat arbitrary total ordering useful mainly for use in std::map or std::set.
>
> Instead, I suggest using SourceManager::isBeforeInTranslationUnit().
Thanks Doug! New patch attached.
Hans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ignored-qualifiers-2.patch
Type: text/x-patch
Size: 2637 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110602/db4c1e0c/attachment.bin>
More information about the cfe-commits
mailing list