summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Testcase for r174477.Chad Rosier2013-02-071-0/+11
| | | | llvm-svn: 174640
* Add AArch64 wchar definition to testTim Northover2013-02-071-1/+1
| | | | | | This should allow it to pass if the default triple is AArch64 llvm-svn: 174620
* Remove unneeded test. We have plenty of subgroup relations between warnings,Ted Kremenek2013-02-061-16/+0
| | | | | | and for those we care about we should have a general way of testing them. llvm-svn: 174531
* Change subexpressions to be visited in the CFG from left-to-right.Ted Kremenek2013-02-051-4/+4
| | | | | | | | | | | | | | | | | This is a more natural order of evaluation, and it is very important for visualization in the static analyzer. Within Xcode, the arrows will not jump from right to left, which looks very visually jarring. It also provides a more natural location for dataflow-based diagnostics. Along the way, we found a case in the analyzer diagnostics where we needed to indicate that a variable was "captured" by a block. -fsyntax-only timings on sqlite3.c show no visible performance change, although this is just one test case. Fixes <rdar://problem/13016513> llvm-svn: 174447
* PR15132: Replace "address expression must be an lvalue or a functionRichard Smith2013-02-023-9/+9
| | | | | | | | | | | | | | designator" diagnostic with more correct and more human-friendly "cannot take address of rvalue of type 'T'". For the case of & &T::f, provide a custom diagnostic, rather than unhelpfully saying "cannot take address of rvalue of type '<overloaded function type>'". For the case of &array_temporary, treat it just like a class temporary (including allowing it as an extension); the existing diagnostic wording for the class temporary case works fine. llvm-svn: 174262
* Fix diagnostic for bad alignas use: it can't be applied to functions.Richard Smith2013-02-011-1/+1
| | | | llvm-svn: 174160
* Implement [dcl.align]p5 and C11 6.7.5/4: alignas cannot underalign.Richard Smith2013-02-011-1/+1
| | | | | | Also support alignas(0), which C++11 and C11 require us to ignore. llvm-svn: 174157
* [Sema][Attr]Fix alignment attribute printing.Michael Han2013-02-011-5/+2
| | | | | | | | | Remove "IsMSDeclspec" argument from Align attribute since the arguments in Attr.td should only model those appear in source code. Introduce attribute Accessor, and teach TableGen to generate syntax kind accessors for Align attribute, and use those accessors to decide if an alignment attribute is a declspec attribute. llvm-svn: 174133
* [Comment parsing] Add support for recognizingFariborz Jahanian2013-01-311-0/+8
| | | | | | | | \headerfile command and representing it in an xml document. Patch reviewed by Dmitri Gribenko. // rdar://12397511 llvm-svn: 174109
* Add indents to AST dumping and removed parenthesis from AST nodes.Richard Trieu2013-01-311-3/+3
| | | | | | | | | | | | | | | | | | | | | Indents were given the color blue when outputting with color. AST dumping now looks like this: Node |-Node | `-Node `-Node `-Node Compared to the previous: (Node (Node (Node)) (Node (Node))) llvm-svn: 174022
* Also promote fp16 types to double when they're anonymous variadic arguments.Tim Northover2013-01-301-0/+13
| | | | | | | | __fp16 isn't covered by the standard, but this resolves the oddity that float gets promoted when passed variadically, but not the smaller type. This is required by the AArch64 ABI, and a sane action elsewhere. llvm-svn: 173918
* Fix test failure from previous change.Richard Smith2013-01-301-0/+1
| | | | llvm-svn: 173899
* Semantic analysis and CodeGen support for C11's _Noreturn. This is modeled asRichard Smith2013-01-301-2/+2
| | | | | | an attribute for consistency with our other noreturn mechanisms. llvm-svn: 173898
* c: When checking on validity of sizeof passed as size ofFariborz Jahanian2013-01-301-0/+15
| | | | | | | | argument to be memset, check for its type to be complete before calling Context.getTypeSize(PointeeTy) to prevent crash. // rdar://13081751. llvm-svn: 173872
* Test update missed in r173789.Richard Smith2013-01-291-1/+6
| | | | llvm-svn: 173790
* Downgrade 'attribute ignored when parsing type' from error to warning, to matchRichard Smith2013-01-292-2/+2
| | | | | | | | | the diagnostic's warn_ name. Switch some places (notably C++11 attributes) which really wanted an error over to a different diagnostic. Finally, suppress the diagnostic entirely for __ptr32, __ptr64 and __w64, to avoid producing diagnostics in important system headers. llvm-svn: 173788
* Implement C++11 [dcl.align]p1 and C11 6.7.5/2 rules for alignas and _Alignas.Richard Smith2013-01-291-2/+6
| | | | llvm-svn: 173779
* Test that we print MS keyword attributes without a __declspec(...) adornment.Richard Smith2013-01-291-0/+7
| | | | llvm-svn: 173754
* Replace AS_MSTypespec with AS_Keyword, for representing any attribute spelledRichard Smith2013-01-291-3/+4
| | | | | | | | | as a keyword. Rationalize existing attributes to use it as appropriate, and to not lie about some __declspec attributes being GNU attributes. In passing, remove a gross hack which was discarding attributes which we could handle. This results in us actually respecting the __pascal keyword again. llvm-svn: 173746
* Comment parsing: attach any tag type's documentation to its typedef if latterDmitri Gribenko2013-01-271-0/+23
| | | | | | | | does not have one of its own. // rdar://13067629 Original patch (r173586 and r173587) by Fariborz Jahanian, modified by me. llvm-svn: 173626
* Comment parsing: actually check for a block command after "\param x"Dmitri Gribenko2013-01-261-0/+28
| | | | | | This fixes PR15068. llvm-svn: 173539
* Add space after ';'.Fariborz Jahanian2013-01-251-4/+4
| | | | llvm-svn: 173462
* Improve diagnsotic further on integer overflow.Fariborz Jahanian2013-01-251-4/+5
| | | | llvm-svn: 173461
* Fixes text of diagnostics in integer overflow patch.Fariborz Jahanian2013-01-241-3/+3
| | | | llvm-svn: 173388
* Patch to check for integer overflow. It has beenFariborz Jahanian2013-01-241-4/+4
| | | | | | commented on and approved by Richard Smith. llvm-svn: 173377
* Handle universal character names and Unicode characters outside of literals.Jordan Rose2013-01-241-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Unify diagnostics for \x, \u, and \U without any following hex digits.Jordan Rose2013-01-241-1/+1
| | | | llvm-svn: 173368
* Fail these tests in a way that doesn't cause unexpected successes, per Daniel'sChad Rosier2013-01-241-2/+1
| | | | | | suggestion. llvm-svn: 173367
* Temporarily XFAIL this test; the compiler will segfault if the target-specificChad Rosier2013-01-241-0/+1
| | | | | | | parser is not included in the compiler. Thanks to Renato for discovering the underlying issue. llvm-svn: 173365
* [ms-inline asm] Add an error when trying to compile MS-style inline assemblyChad Rosier2013-01-241-0/+5
| | | | | | | for an unsupported architecture. rdar://13063988 llvm-svn: 173364
* PR14922: when printing an attribute, use the real syntax of the attribute ↵Michael Han2013-01-241-0/+16
| | | | | | | | | | | | | (GNU, C++11, MS Declspec) instead of hardcoded GNU syntax. Introduce a spelling index to Attr class, which is an index into the attribute spelling list of an attribute defined in Attr.td. This index will determine the actual spelling used by an attribute, as it incorporates both the syntax and naming of the attribute. When constructing an attribute AST node, the spelling index is computed based on attribute kind, scope (if it's a C++11 attribute), and name, then passed to Attr that will use the index to print itself. Thanks to Richard Smith for the idea and review. llvm-svn: 173358
* Properly remove this test file, that I copied over to test/SemaOpenCL in ↵Joey Gouly2013-01-241-14/+0
| | | | | | r173352. llvm-svn: 173353
* Implement -Wvla correctlyDmitri Gribenko2013-01-231-0/+12
| | | | | | | | | | | | | GCC implements -Wvla as "warn on every VLA" (this is useful to find every VLA, for example, if they are forbidden by coding guidelines). Currently Clang implements -Wvla as "warn on VLA when it is an extension". The attached patch makes our behavior match GCC. The existing vla extwarn is moved under -Wvla-extension and is still included into -Wgnu. This fixes PR5953. llvm-svn: 173286
* [ms-inline asm] Remove the -fenable-experimental-ms-inline-asm flag. MS-styleChad Rosier2013-01-221-1/+1
| | | | | | inline assembly can be enable with -fasm-blocks or -fms-extensions alone. llvm-svn: 173186
* Split "discards qualifiers" warnings of -Wincompatible-pointer-types into ↵Ted Kremenek2013-01-221-0/+16
| | | | | | | | | | | | subgroup. This allows users to promote -Wincompatible-pointer-type warnings to errors but keep those for "discard qualifiers" as warnings (if they so desire). Addresses <rdar://problem/13062738>. llvm-svn: 173184
* Add a fixit for _Noreturn main,Dmitri Gribenko2013-01-211-0/+32
| | | | | | add tests for fixits removing static and inline from main llvm-svn: 173024
* [ms-inline asm] Test case for r172773.Chad Rosier2013-01-181-0/+12
| | | | llvm-svn: 172774
* Format strings: don't ever convert %+d to %lu.Jordan Rose2013-01-171-4/+4
| | | | | | | | | | Presumably, if the printf format has the sign explicitly requested, the user wants to treat the data as signed. This is a fix-up for r172739, and also includes several test changes that didn't make it into that commit. llvm-svn: 172762
* Parsing support for C11's _Noreturn keyword. No semantics yet.Richard Smith2013-01-171-0/+5
| | | | llvm-svn: 172761
* [ms-inline asm] Updates and test case for r172743.Chad Rosier2013-01-171-16/+0
| | | | | | Part of rdar://12576868 llvm-svn: 172744
* Suppress all -Wunused-value warnings from macro body expansions.Matt Beaumont-Gay2013-01-171-3/+20
| | | | | | | | | | | | | | | | | | | This is inspired by a number of false positives in real code, including PR14968. I've added test cases reduced from these false positives to test/Sema/unused-expr.c, as well as corresponding test cases that pass the offending expressions as arguments to a no-op macro to ensure that we do warn there. This also removes my previous tweak from r166522/r166534, so that we warn on unused cast expressions in macro arguments. There were several test cases that were using -Wunused-value to test general diagnostic emission features; I changed those to use other warnings or warn on a macro argument expression. I stared at the test case for PR14399 for a while with Richard Smith and we believe the new test case exercises the same codepaths as before. llvm-svn: 172696
* Implement a fixit for -Wmain-return-typeDmitri Gribenko2013-01-172-1/+50
| | | | llvm-svn: 172684
* Check for internal weak decls after merging.Rafael Espindola2013-01-161-0/+6
| | | | | | | | This fixes pr14946. The problem was that the linkage computation was done too early, so things like "extern int a;" would be given external linkage, even if a previous declaration was static. llvm-svn: 172667
* First step in implementation of mips16 and nomips16 attributes.Reed Kotler2013-01-162-0/+34
| | | | | | Waiting for new llvm attribute code for the next step. llvm-svn: 172626
* Add a comment to test to clarify the intention hereDmitri Gribenko2013-01-121-0/+3
| | | | | | Comment is taken from the commit message of r151080, by Jean-Daniel Dupas llvm-svn: 172332
* Fix -Wunused-comparison for comparisons in arguments to function-like macros.Matt Beaumont-Gay2013-01-121-2/+4
| | | | | | | | | | | Previously, -Wunused-comparison ignored comparisons in both macro bodies and macro arguments, but we would still emit a -Wunused-value warning for either. Now we correctly emit -Wunused-comparison for expressions in macro arguments. Also, add isMacroBodyExpansion to SourceManager, to go along with isMacroArgExpansion. llvm-svn: 172279
* Reject incompatible redeclarations of extern C symbols.Rafael Espindola2013-01-111-2/+0
| | | | | | | Before we were only checking if the new declaration itself was marked extern C. Fixes prpr14766. llvm-svn: 172243
* Improve diagnostic per Richard's suggestionFariborz Jahanian2013-01-111-2/+2
| | | | | | | (which may yet change if we move the diagnostic outside case value). llvm-svn: 172242
* Provide a better warning when case value overflows.Fariborz Jahanian2013-01-101-2/+2
| | | | | | // rdar://11577384 llvm-svn: 172102
* Issue warning when case value is too large to fitFariborz Jahanian2013-01-091-0/+17
| | | | | | | | | in case condition type. // rdar://11577384. Test is conditionalized on x86_64-apple triple as I am not sure if the INT_MAX/LONG_MAX values in the test will pass this test for other hosts. llvm-svn: 172016
OpenPOWER on IntegriCloud