summaryrefslogtreecommitdiffstats
path: root/clang/test/FixIt/fixit-unicode.c
Commit message (Collapse)AuthorAgeFilesLines
* Test for correct usage of columnWidth in clang fixit hints.Alexander Kornienko2013-09-111-3/+12
| | | | | | | | | | | | | | | | | Summary: This test only works on systems capable of outputting UTF-8 encoded text on the standard output (tested on linux and OS X, should XFAIL on windows, if I haven't messed up the XFAIL line). Reviewers: jordan_rose Reviewed By: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1607 llvm-svn: 190537
* Add 'not' to commands that are expected to fail.Rafael Espindola2013-07-041-2/+2
| | | | | | | This is at least good documentation, but also opens the possibility of using pipefail. llvm-svn: 185652
* Handle Unicode characters in fix-it replacement strings.Jordan Rose2013-06-071-0/+20
| | | | | | Patch by Sukolsak Sakshuwong! llvm-svn: 183535
* Test fix-it ranges for Unicode characters.Jordan Rose2013-01-241-1/+2
| | | | | | Also, remove stray -fdiagnostics-parseable-fixits from ucn-pp-identifier. llvm-svn: 173373
* Handle universal character names and Unicode characters outside of literals.Jordan Rose2013-01-241-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | This is a missing piece for C99 conformance. This patch handles UCNs by adding a '\\' case to LexTokenInternal and LexIdentifier -- if we see a backslash, we tentatively try to read in a UCN. If the UCN is not syntactically well-formed, we fall back to the old treatment: a backslash followed by an identifier beginning with 'u' (or 'U'). Because the spelling of an identifier with UCNs still has the UCN in it, we need to convert that to UTF-8 in Preprocessor::LookUpIdentifierInfo. Of course, valid code that does *not* use UCNs will see only a very minimal performance hit (checks after each identifier for non-ASCII characters, checks when converting raw_identifiers to identifiers that they do not contain UCNs, and checks when getting the spelling of an identifier that it does not contain a UCN). This patch also adds basic support for actual UTF-8 in the source. This is treated almost exactly the same as UCNs except that we consider stray Unicode characters to be mistakes and offer a fixit to remove them. llvm-svn: 173369
* Re-apply r160319 "Don't crash when emitting fixits following Unicode chars"Jordan Rose2012-07-201-1/+19
| | | | | | | | | This time, make sure we don't try to print fixits with newline characters, since they don't have a valid column width, and they don't look good anyway. PR13417 (and originally <rdar://problem/11877454>) llvm-svn: 160561
* Revert r160319, it caused PR13417. Add a test for PR13417.Nico Weber2012-07-201-19/+1
| | | | llvm-svn: 160542
* Weaken Unicode fixit test to work even if the character is printed escaped.Jordan Rose2012-07-161-4/+5
| | | | | | This should fix the failure on Windows. llvm-svn: 160324
* This test appears to fail on win32.Ted Kremenek2012-07-161-0/+1
| | | | llvm-svn: 160322
* Don't crash when emitting fixits following Unicode characters.Jordan Rose2012-07-161-1/+17
| | | | | | | | | | | | | | | This code is very sensitive to the difference between "columns" as printed and "bytes" (SourceManager columns). All variables are now named explicitly and our assumptions are (hopefully) documented as both comment and assertion. Whether parseable fixits should use byte offsets or Unicode character counts is pending discussion on the mailing list; currently the implementation uses bytes (and has no problems on lines containing multibyte characters). This has been added to the user manual. <rdar://problem/11877454> llvm-svn: 160319
* Be lax about trailing whitespace when checking fixit formatting, this ↵Benjamin Kramer2012-07-121-2/+2
| | | | | | | | | | depends on locale settings. If a non-unicode locale is used, the unicode character is escaped and any byte that is in the escaped representation but not the semicolon will become whitespace. llvm-svn: 160113
* PR13312: Don't crash when printing a fixit that ends in a unicode character.Benjamin Kramer2012-07-121-0/+15
llvm-svn: 160112
OpenPOWER on IntegriCloud