summaryrefslogtreecommitdiffstats
path: root/clang/test/Lexer
Commit message (Collapse)AuthorAgeFilesLines
* Fixing some comments in this test. No functional changes.Aaron Ballman2014-05-191-3/+3
| | | | llvm-svn: 209128
* PR19698, PR19674: enable __has_feature checks for cxx_generic_lambdas andRichard Smith2014-05-091-0/+20
| | | | | | | cxx_decltype_auto, and fix documentation of cxx_generic_lambdas and cxx_init_captures to specify the right feature-check name. llvm-svn: 208445
* Clean up some existing keyword tests in the test/Lexer directory by using theYunzhong Gao2014-05-074-19/+34
| | | | | | | | pre-defined __is_identifier() macro. Differential Revision: http://reviews.llvm.org/D3460 llvm-svn: 208147
* Add some missing checks for C++1y digit separators that don't in fact separateRichard Smith2014-04-221-0/+14
| | | | | | | | digits. Turns out we have completely separate lexing codepaths for floating point numbers depending on whether or not they start with a zero. Who knew... =) llvm-svn: 206932
* Lex: Fix __has_feature(cxx_exceptions) for objective C++Justin Bogner2014-04-161-1/+7
| | | | | | | | | | | | | | | At one point, -fexceptions was a synonym for -fcxx-exceptions. While the driver options still enables cxx-exceptions by default, the cc1 flag is purely about exception tables and this doesn't account for objective C exceptions. Because of this, checking for the cxx_exceptions feature in objective C++ often gives the wrong answer. The cxx_exceptions feature should be based on the -fcxx-exceptions cc1 flag, not -fexceptions. Furthermore, at some point the tests were changed to use cc1 even though they were testing the driver behaviour. We're better off testing both the driver and cc1 here. llvm-svn: 206352
* Add a test to distinguish between reserved tokens and normal identifiers.Yunzhong Gao2014-04-111-0/+29
| | | | | | | | | | | | The -fms-extensions option affects a number of subtle front-end C/C++ behaviors, and it would be useful to be able to distinguish MS keywords from regular identifiers in the ms-extensions mode even if the triple does not define a Windows target. It should make life easier if anyone needs to port their Windows codes to elsewhere. Differential Revision: http://reviews.llvm.org/D3034 llvm-svn: 206069
* Added a __has_feature() for 'is_constructible'Marshall Clow2014-03-181-0/+5
| | | | llvm-svn: 204153
* Disable cross-windows-on-linux.cpp for now. It may or may not fail. :/NAKAMURA Takumi2014-03-121-0/+3
| | | | llvm-svn: 203642
* Lexer: split test into separate filesSaleem Abdulrasool2014-03-122-10/+14
| | | | | | | | Unfortunately, XFAIL applies to the entire file. Split the test into two different units, enabling the proper application of XFAIL on the test which is expected to fail on Windows. llvm-svn: 203633
* Lex: reduce buffer size, add a testSaleem Abdulrasool2014-03-122-0/+15
| | | | | | | Reduce the stack usage as hopefully include paths are usually not too long. Add a test case for the path normalisation behaviour. llvm-svn: 203632
* Tests for lexing of digit separators versus UCNs.Richard Smith2014-02-281-0/+20
| | | | llvm-svn: 202534
* Fix a minor bug in lexing pp-numbers with digit separators: if a pp-number ↵Richard Smith2014-02-281-0/+2
| | | | | | contains "'e+", the pp-number ends between the 'e' and the '+'. llvm-svn: 202533
* Lexer: Issue -Wbackslash-newline-escape for line commentsAlp Toker2013-12-141-0/+1
| | | | | | | | | | | | The warning for backslash and newline separated by whitespace was missed in this code path. backslash<whitespace><newline> is handled differently from compiler to compiler so it's important to warn consistently where there's ambiguity. Matches similar handling of block comments and non-comment lines. llvm-svn: 197331
* Revert "Don't require -re suffix on -verify directives with regexes."Alp Toker2013-12-141-1/+1
| | | | | | | | | | This patch was submitted to the list for review and didn't receive a LGTM. (In fact one explicit objection and one query were raised.) This reverts commit r197295. llvm-svn: 197299
* Don't require -re suffix on -verify directives with regexes.Hans Wennborg2013-12-141-1/+1
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2392 llvm-svn: 197295
* Change semantics of regex expectations in the diagnostic verifierHans Wennborg2013-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Previously, a line like // expected-error-re {{foo}} treats the entirety of foo as a regex. This is inconvenient when matching type names containing regex characters. For example, to match "void *(class test8::A::*)(void)" inside such a regex, one would have to type "void \*\(class test8::A::\*\)\(void\)". This patch changes the semantics of expected-error-re to only treat the parts of the directive wrapped in double curly braces as regexes. This avoids the escaping problem and leads to nicer patterns for those cases; see e.g. the change to test/Sema/format-strings-scanf.c. (The balanced search for closing }} of a directive also makes us handle the full directive in test\SemaCXX\constexpr-printing.cpp:41 and :53.) Differential Revision: http://llvm-reviews.chandlerc.com/D2388 llvm-svn: 197092
* Add support for C++'s SD6 feature test macros.Richard Smith2013-11-271-0/+89
| | | | llvm-svn: 195888
* Relax header guard mismatch warning with edit distance heuristic.Ismail Pazarbasi2013-10-122-0/+6
| | | | | | If the edit distance between the two macros is more than 50%, DefinedMacro may not be header guard or can be header guard of another header file or it might be defining something completely different set by the build environment. llvm-svn: 192547
* Mark lambda init-captures as complete.Richard Smith2013-09-282-1/+18
| | | | llvm-svn: 191607
* Mark variable template implementation as complete. Nearly all of the creditRichard Smith2013-09-272-5/+16
| | | | | | here goes to Larisse Voufo. llvm-svn: 191549
* Add macro test from N3781.Richard Smith2013-09-261-0/+5
| | | | llvm-svn: 191444
* Per updates to D3781, allow underscore under ' in a pp-number, and allow ' ↵Richard Smith2013-09-261-2/+6
| | | | | | in a #line directive. llvm-svn: 191443
* Implement C++1y digit separator proposal (' as a digit separator). This is notRichard Smith2013-09-262-0/+35
| | | | | | yet approved by full committee, but was unanimously supported by EWG. llvm-svn: 191417
* Lex and ignore Microsoft's #pragma warning(...)Reid Kleckner2013-09-131-0/+22
| | | | | | | | | | | | | | | | | Summary: This fixes PR17145 and avoids unknown pragma warnings. This change does not attempt to map MSVC warning numbers to clang warning flags. Perhaps in the future we will implement a mapping for some common subset of Microsoft warnings, but for now we don't. Reviewers: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1652 llvm-svn: 190726
* Add specific warning flags for GNU ext in lexer.Eli Friedman2013-09-051-0/+56
| | | | | | | | | | | | | This patch adds the following flags covering existing warnings: -Wgnu-zero-variadic-macro-arguments -Wgnu-imaginary-constant -Wgnu-binary-literal -Wgnu-zero-line-directive Patch by Peter Lewis. llvm-svn: 190017
* Revise -Wnewline-eof test per feedback from Dmitri.Jordan Rose2013-08-231-6/+6
| | | | llvm-svn: 189113
* Respect -Wnewline-eof even in C++11 mode.Jordan Rose2013-08-233-8/+10
| | | | | | | | | | | If the user has requested this warning, we should emit it, even if it's not an extension in the current language mode. However, being an extension is more important, so prefer the pedantic warning or the pedantic-compatibility warning if those are enabled. <rdar://problem/12922063> llvm-svn: 189110
* Revert r188863 which could propose wrong fixits for multibyte character ↵Nick Lewycky2013-08-211-11/+0
| | | | | | literals. llvm-svn: 188918
* Issue fixits replacing invalid character literals with the equivalent \xNNNick Lewycky2013-08-211-0/+11
| | | | | | escape code. llvm-svn: 188863
* Fix FileCheck --check-prefix lines.Tim Northover2013-08-122-3/+3
| | | | | | | | | | Various tests had sprung up over the years which had --check-prefix=ABC on the RUN line, but "CHECK-ABC:" later on. This happened to work before, but was strictly incorrect. FileCheck is getting stricter soon though. Patch by Ron Ofir. llvm-svn: 188174
* Partially revert r186903.Eli Friedman2013-07-261-1/+1
| | | | | | | | It turns out that Plum Hall depends on us not emitting an error on integer literals which fit into long long, but fit into unsigned long long. So C99 conformance requires not conforming to C99. :) llvm-svn: 187172
* Update documentation to match current C++1y feature set.Richard Smith2013-07-241-0/+20
| | | | llvm-svn: 187055
* Integers which are too large should be an error.Eli Friedman2013-07-231-1/+6
| | | | | | | | Switch some warnings over to errors which should never have been warnings in the first place. (Also, a minor fix to the preprocessor rules for integer literals while I'm here.) llvm-svn: 186903
* Add 'not' to commands that are expected to fail.Rafael Espindola2013-07-043-3/+3
| | | | | | | This is at least good documentation, but also opens the possibility of using pipefail. llvm-svn: 185652
* PR16339: Don't produce a diagnostic pointing at the whitespace between a '#if'Richard Smith2013-06-162-1/+15
| | | | | | | | and a '!defined(X)' if we find a broken header guard. This is suboptimal; we should point the diagnostic at the 'X' token not the 'if' token, but it fixes the crash. llvm-svn: 184054
* Introducing -Wheader-guard, a warning that checks header guards actually workRichard Trieu2013-06-128-0/+66
| | | | | | | | properly. This warning checks that the #ifndef and #define directives at the beginning of a header refer to the same macro name. Includes a fix-it hint to correct the header guard. llvm-svn: 183867
* Better diagnostics for string initialization.Hans Wennborg2013-05-151-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit improves Clang's diagnostics for string initialization. Where it would previously say: /tmp/a.c:3:9: error: array initializer must be an initializer list wchar_t s[] = "Hi"; ^ /tmp/a.c:4:6: error: array initializer must be an initializer list or string literal char t[] = L"Hi"; ^ It will now say /tmp/a.c:3:9: error: initializing wide char array with non-wide string literal wchar_t s[] = "Hi"; ^ /tmp/a.c:4:6: error: initializing char array with wide string literal char t[] = L"Hi"; ^ As a bonus, it also fixes the fact that Clang would previously reject this valid C11 code: char16_t s[] = u"hi"; char32_t t[] = U"hi"; because it would only recognize the built-in types for char16_t and char32_t, which do not exist in C. llvm-svn: 181880
* C++1y: provide full 'auto' return type deduction for lambda expressions. ThisRichard Smith2013-05-121-0/+10
| | | | | | completes the implementation of N3638. llvm-svn: 181669
* C++1y: Update __cplusplus to temporary value 201305L to allow detection of ↵Richard Smith2013-05-072-64/+124
| | | | | | | | | provisional C++1y support. Add __has_feature and __has_extension checks for C++1y features (based on the provisional names from the C++ features study group), and update documentation to match. llvm-svn: 181342
* Reverting r181004 since it has broken test/Sema/wchar.c.Aaron Ballman2013-05-042-24/+0
| | | | llvm-svn: 181122
* Support __wchar_t in -fms-extensions and -fms-compatibility modes.Hans Wennborg2013-05-032-0/+24
| | | | | | | | | | | | | | MSVC provides __wchar_t, either as an alias for the built-in wchar_t type, or as a separate type depending on language (C vs C++) and flags (-fno-wchar). In -fms-extensions, Clang will simply accept __wchar_t as an alias for whatever type is used for wide character literals. In -fms-compatibility, we try to mimic MSVC's behavior by always making __wchar_t a builtin type. This fixes PR15815. llvm-svn: 181004
* Use a triple ensure that __has_feature(c_thread_local) is 1 in C11 mode.Douglas Gregor2013-05-021-1/+1
| | | | llvm-svn: 180925
* Only evaluate __has_feature(c_thread_local) and ↵Douglas Gregor2013-05-021-2/+4
| | | | | | __has_feature(cxx_thread_local) true when the target supports thread-local storage. llvm-svn: 180909
* Note that we support (and in fact have supported since the dawn of time itself)Richard Smith2013-04-191-0/+19
| | | | | | C++1y binary literals. llvm-svn: 179883
* Keep the parentheses in #pragma message (partial revert of r179771).Andy Gibbs2013-04-192-3/+3
| | | | llvm-svn: 179862
* C++11 support is now feature-complete.Richard Smith2013-04-192-0/+27
| | | | llvm-svn: 179861
* Dropped the parentheses for #pragma message and its kin in the -E output ↵Andy Gibbs2013-04-182-1/+20
| | | | | | | | generator. This was a suggestion by Jordan Rose since the documented format for these pragmas is without the parentheses. At the same time, I've increased test coverage too for the preprocessed output. llvm-svn: 179771
* Implemented #pragma GCC warning/error in the same mould as #pragma message.Andy Gibbs2013-04-171-0/+16
| | | | llvm-svn: 179687
* Add -Wc99-compat warning for C11 unicode string and character literals.Richard Smith2013-03-111-0/+21
| | | | llvm-svn: 176817
* When lexing in C11 mode, accept unicode character and string literals, per C11Richard Smith2013-03-093-1/+33
| | | | | | 6.4.4.4/1 and 6.4.5/1. llvm-svn: 176780
OpenPOWER on IntegriCloud