In code such as "char* volatile const j()", Clang warns that "volatile
const" will be ignored, but the error currently points to the location
of "const". The attached patch makes the error point to the location
of the first ignored qualifier.
Chandler: I've been looking at the FIXME in this code (it was added in
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?r1=126321&r2=126320&pathrev=126321),
and I'm not sure what you mean when you say that we should find a
range that encompass all the qualifiers instead.
Do you mean that Loc should be a SourceRange, covering all ignored
qualifiers? But Sema::Diag() only expects a SourceLocation, not a
range?
Or do you mean that the ConstFixIt, VolatileFixIt, RestrictFixIt
should be replaced by a single fixit, using to a range covering all
qualifiers? Does that make any real difference? Also, can we be sure
that these qualifiers are always consecutive (I'm too tired to think
that through at the moment).
Cheers,
Hans
ignored-qualifiers.patch (2.23 KB)