-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect range of <angled> include fixit #14252
Comments
This was caused by r163588. |
Use in InclusionDirective separate location variable pointing before > case tok::angle_string_literal:
Later CharEnd is used to compute fixit range, causing too long range. Also the same problem should be present for @__experimental_modules_import fixit, but I didn't try to reproduce it. I'd like to note that mentioned change also causes clang::SourceManager::getIncludeLoc(FileID FID) const to return location pointing at '>'. But for include-what-you-use tool I need to get include name as typed and it was convenient when getIncludeLoc() returned location pointing at '<' or '"' (opening quotation mark). I've created a patch according to my getIncludeLoc() preferences which fixes this issue. Please find patch attached. |
We're already in discussion about the right way to fix this: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120917/064551.html |
Fixed in r164743. |
Confirm that bug is fixed. Should I change the issue state to VERIFIED or CLOSED? |
Extended Description
Steps to Reproduce:
In llvm/tools/clang/test/FixIt run
$ clang -fsyntax-only fixit-include.c
Actual Results:
fixit-include.c:7:10: error: 'fixit-include.h' file not found with include; use "quotes" instead
#include <fixit-include.h> // expected-error {{'fixit-include.h' file not found with include; use "quotes" instead}}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"fixit-include.h"
1 error generated.
Expected Results:
fixit-include.c:7:10: error: 'fixit-include.h' file not found with include; use "quotes" instead
#include <fixit-include.h> // expected-error {{'fixit-include.h' file not found with include; use "quotes" instead}}
^~~~~~~~~~~~~~~~~
"fixit-include.h"
1 error generated.
I.e. fixit range shouldn't go beyond right angled bracket.
Build Date & Platform:
Build 09/20/2012 (r164256) on Mac OS X 10.6.8.
The text was updated successfully, but these errors were encountered: