summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc
Commit message (Collapse)AuthorAgeFilesLines
* Reenable Misc/interpreter.c as r239388 correctly handles such targetsDavid Majnemer2015-06-091-1/+1
| | | | llvm-svn: 239389
* Disable clang/test/Misc/interpreter.c, for now, since r239273 mishandled ↵NAKAMURA Takumi2015-06-091-1/+1
| | | | | | *-msvc-elf. llvm-svn: 239387
* Fix typo from r237482. "to reference of type" --> "to reference to type"Richard Trieu2015-05-161-1/+1
| | | | llvm-svn: 237507
* When emitting a dropped qualifier error, show which qualifiers are dropped.Richard Trieu2015-05-161-1/+1
| | | | llvm-svn: 237505
* Reverse the order of types in the reference dropping qualifiers error.Richard Trieu2015-05-151-1/+1
| | | | | | | | The error has the form ... 'int' ... 'const int' ... dropped qualifiers. At first glance, it appears that the const qualifier is added. Reverse the types so that the second type is less qualified than the first. llvm-svn: 237482
* Fix BackendConsumer::EmitOptimizationMessage()Diego Novillo2015-05-081-0/+21
| | | | | | | | | | | Patch from Geoff Berry <gberry@codeaurora.org> Fix BackendConsumer::EmitOptimizationMessage() to check if the DiagnosticInfoOptimizationBase object has a valid location before calling getLocation() to avoid dereferencing a null pointer inside getLocation() when no debug info is present. llvm-svn: 236898
* Generate a diagnostic when a catch handler cannot execute due to class ↵Aaron Ballman2015-04-081-2/+1
| | | | | | hierarchy inversion with regards to other catch handlers for the same block. llvm-svn: 234375
* Record correct source range for defaulted/deleted members.Eli Bendersky2015-03-231-7/+6
| | | | | | | | | | | | | | | | | | | Fixes https://llvm.org/bugs/show_bug.cgi?id=20744 struct A { A() = default; }; Previously the source range of the declaration of A ended at the ')'. It should include the '= default' part as well. The same for '= delete'. Note: this will break one of the clang-tidy fixers, which is going to be addessed in a follow-up patch. Differential Revision: http://reviews.llvm.org/D8465 llvm-svn: 233028
* Fix -ast-dump of dependent new and delete exprsReid Kleckner2015-03-191-0/+10
| | | | llvm-svn: 232748
* Add -ast-dump support for new and delete expressions to help figure out ↵Reid Kleckner2015-03-191-0/+17
| | | | | | which operator got selected llvm-svn: 232740
* Fix test case.Sanjoy Das2015-03-021-2/+2
| | | | | | | | | | r230921 broke backend-optimization-failure.cpp: after r230921, LLVM no longer emits an expression to compute 'Length - 1' and this perturbs LoopSimplify enough to emit the warning on line 10 instead of line 9. This is a review request to fix the test case once I re-land r230921. llvm-svn: 231020
* Update assumption in template diffing about integer template arguments.Richard Trieu2015-02-261-0/+13
| | | | | | | | | | Fix for PR22017. Integer template arguments are automatically bit extended to the size of the integer type. In template diffing, evaluated expressions were not having their results extending, leading to comparing two APSInt's with different widths. Apply the proper bit extending when evaluating template arguments. This mainly affected bool template arguments. llvm-svn: 230603
* Partial revert of r229336; this wasn't intended to go in.Aaron Ballman2015-02-151-1/+2
| | | | llvm-svn: 229338
* Removing LLVM_EXPLICIT, as MSVC 2012 was the last reason for requiring the ↵Aaron Ballman2015-02-151-2/+1
| | | | | | macro. NFC; Clang edition. llvm-svn: 229336
* Improve the "braces around scalar init" warning to determine whether to warnRichard Smith2015-02-121-3/+1
| | | | | | | | based on whether "redundant" braces are ever reasonable as part of the initialization of the entity, rather than whether the initialization is "top-level". In passing, add a warning flag for it. llvm-svn: 228896
* When checking the template argument list, use a copy of that list for changesRichard Trieu2015-01-241-0/+14
| | | | | | | | | | | | | | | | | | | and only update the orginal list on a valid arugment list. When checking an individual expression template argument, and conversions are required, update the expression in the template argument. Since template arguments are speculatively checked, the copying of the template argument list prevents updating the template arguments when the list does not match the template. Additionally, clean up the integer checking code in the template diffing code. The code performs unneccessary conversions from APSInt to APInt. Fixes PR21758. This essentially reverts r224770 to recommits r224667 and r224668 with extra changes to prevent the template instantiation problems seen in PR22006. A test to catch the discovered problem is also added. llvm-svn: 226983
* Sema: Variable definitions cannot be __attribute__((alias))David Majnemer2015-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | Things that are OK: extern int var1 __attribute((alias("v1"))); static int var2 __attribute((alias("v2"))); Things that are not OK: int var3 __attribute((alias("v3"))); extern int var4 __attribute((alias("v4"))) = 4; We choose to accpet: struct S { static int var5 __attribute((alias("v5"))); }; This code causes assertion failues in GCC 4.8 and ICC 13.0.1, we have no reason to reject it. This partially fixes PR22217. llvm-svn: 226436
* Attempt to fix test from r225423 to get build bots green.Richard Trieu2015-01-081-7/+7
| | | | llvm-svn: 225426
* When the diagnostic text is simply "%0", sanitize the string for anyRichard Trieu2015-01-081-0/+11
| | | | | | unprintable characters. Fixes PR22048. llvm-svn: 225423
* Remove an assert that's not true on invalid code.Nico Weber2015-01-041-0/+20
| | | | | | | | | | r185773 added an assert that checked that a CXXUnresolvedConstructExpr either has a valid rparen, or exactly one argument. This doesn't have to be true for invalid inputs. Convert the assert to an if, and add a test for this case. Found by SLi's afl bot. llvm-svn: 225140
* This reverts commit r224668 and r224667.Rafael Espindola2014-12-231-14/+0
| | | | | | | | | | r224667 broke bootstrap on Fedora 20 X86_64 (at least). See pr22006 for the details. r224668 depends on r224667. llvm-svn: 224770
* Fix for PR21758Richard Trieu2014-12-201-0/+14
| | | | | | | | | When a non-type template argument expression needs a conversion to change it into the argument type, preserve that information by remaking the TemplateArgument with an expression that has those conversions. Also a small fix to template type diffing to handle the extra conversions in some cases. llvm-svn: 224667
* Objective-C. Provide group name for warningFariborz Jahanian2014-12-181-2/+1
| | | | | | | on multiple selector names found during lookup. rdar://19265296 llvm-svn: 224536
* ASTDumper: print whether a function is constexprHans Wennborg2014-12-051-5/+5
| | | | llvm-svn: 223538
* Another warning with no group name bites the dust.Fariborz Jahanian2014-12-021-2/+1
| | | | | | rdar://19116886 llvm-svn: 223168
* Refactor tree printing in AST dumping.Richard Smith2014-10-301-2/+2
| | | | | | | | | | | Instead of manually maintaining a flag indicating whether we're about to print out the last child of the parent node (to determine whether we print "`" or "|"), capture a callable to print that child and defer printing it until we either see a next child or finish the parent. No functionality change intended. llvm-svn: 220930
* Prune CRLF.NAKAMURA Takumi2014-10-273-26/+26
| | | | llvm-svn: 220678
* Driver: Include driver diagnostics when we --serialize-diagnosticsJustin Bogner2014-10-231-0/+20
| | | | | | | | | | | | | | | Currently, when --serialize-diagnostics is passed this only includes the diagnostics from clang -cc1, and driver diagnostics are dropped. This causes issues for tools that use the serialized diagnostics, since stderr is lost and these diagnostics aren't seen at all. We handle this by merging the diagnostics from the CC1 process and the driver diagnostics into a single file when the driver invokes CC1. Fixes rdar://problem/10585062 llvm-svn: 220525
* Basic: Add ext_delete_void_ptr_operand to -Wdelete-incompleteDavid Majnemer2014-10-221-2/+1
| | | | | | This fixes PR21340. llvm-svn: 220442
* Adding attributes to the IndirectFieldDecl that we generate for anonymous ↵Aaron Ballman2014-10-151-1/+16
| | | | | | struct/union fields. This fixes PR20930. llvm-svn: 219807
* Allow constant expressions in pragma loop hints.Tyler Nowicki2014-10-121-0/+15
| | | | | | | | Previously loop hints such as #pragma loop vectorize_width(#) required a constant. This patch allows a constant expression to be used as well. Such as a non-type template parameter or an expression (2 * c + 1). Reviewed by Richard Smith llvm-svn: 219589
* Correctly handle reading locations from serialized diagnosticsJustin Bogner2014-10-101-1/+1
| | | | | | | | | | | | | | When reading a serialized diagnostic location with no file ID, we were failing to increment the cursor past the rest of the location. This would lead to the flags and category always appearing blank in such diagnostics. This changes the function to unconditionally increment the cursor and updates the test to check for the correct output instead of testing that we were doing this wrong. I've also updated the error check to check for the correct number of fields. llvm-svn: 219538
* Patch to wrap up '_' as separator in version numbersFariborz Jahanian2014-10-061-2/+2
| | | | | | | | | in availability attribute by preserving this info. in VersionTuple and using it in pretty printing of attributes and yet using '.' as separator when diagnosing unavailable message calls. rdar://18490958 llvm-svn: 219124
* Objective-C. Assortment of improvements pretty printingFariborz Jahanian2014-10-031-0/+41
| | | | | | | objective-C declarations, including printing of availability attributes on methods. llvm-svn: 219013
* Objective-C [qoi] - provide group name forFariborz Jahanian2014-09-291-2/+1
| | | | | | warn_property_types_are_incompatible. rdar://18487506 llvm-svn: 218621
* Move calls to ResolveExceptionSpec out of SetDeclDefaulted and into ↵Ben Langmuir2014-09-251-5/+5
| | | | | | | | | DefineImplicit* This fixes an assertion failure in CodeGen where we were not resolving an exception specification. llvm-svn: 218466
* Don't print 'NULL TYPE' when dumping a delegating constructor.Richard Trieu2014-09-121-0/+5
| | | | llvm-svn: 217707
* Add -Wunused-local-typedef, a warning that finds unused local typedefs.Nico Weber2014-09-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning warns on TypedefNameDecls -- typedefs and C++11 using aliases -- that are !isReferenced(). Since the isReferenced() bit on TypedefNameDecls wasn't used for anything before this warning it wasn't always set correctly, so this patch also adds a few missing MarkAnyDeclReferenced() calls in various places for TypedefNameDecls. This is made a bit complicated due to local typedefs possibly being used only after their local scope has closed. Consider: template <class T> void template_fun(T t) { typename T::Foo s3foo; // YYY (void)s3foo; } void template_fun_user() { struct Local { typedef int Foo; // XXX } p; template_fun(p); } Here the typedef in XXX is only used at end-of-translation unit, when YYY in template_fun() gets instantiated. To handle this, typedefs that are unused when their scope exits are added to a set of potentially unused typedefs, and that set gets checked at end-of-TU. Typedefs that are still unused at that point then get warned on. There's also serialization code for this set, so that the warning works with precompiled headers and modules. For modules, the warning is emitted when the module is built, for precompiled headers each time the header gets used. Finally, consider a function using C++14 auto return types to return a local type defined in a header: auto f() { struct S { typedef int a; }; return S(); } Here, the typedef escapes its local scope and could be used by only some translation units including the header. To not warn on this, add a RecursiveASTVisitor that marks all delcs on local types returned from auto functions as referenced. (Except if it's a function with internal linkage, or the decls are private and the local type has no friends -- in these cases, it _is_ safe to warn.) Several of the included testcases (most of the interesting ones) were provided by Richard Smith. (gcc's spelling -Wunused-local-typedefs is supported as an alias for this warning.) llvm-svn: 217298
* Adjust test to handle fallout from r217102.David Majnemer2014-09-031-2/+2
| | | | llvm-svn: 217104
* Add a warning flag for an existing diagnostic.Nico Weber2014-08-181-2/+1
| | | | | | | One more, and the number of flags without a dedicated flag fits in two decimal digits :-) llvm-svn: 215946
* Adding some test cases to test attribute-related source range diagnostics. ↵Aaron Ballman2014-08-121-0/+16
| | | | | | This augments r214722, r214723 and r214507. llvm-svn: 215444
* Modify behavior of -ast-dump-lookups: if -ast-dump is not also provided, dumpRichard Smith2014-08-111-0/+38
| | | | | | | | anyway. If -ast-dump *is* also provided, then dump the AST declarations as well as the lookup results. This is invaluable for cross-correlating the lookup information with the declarations actually found. llvm-svn: 215393
* Provide warning name for property attribute warningFariborz Jahanian2014-07-291-3/+1
| | | | | | mismatch. //rdar://17845264 llvm-svn: 214203
* If a template argument is non-evaluable expression, use the profile ID to seeRichard Trieu2014-07-261-0/+35
| | | | | | if the two arguments are equal. llvm-svn: 214008
* Pass the PrintingPolicy when converting types to strings in template typeRichard Trieu2014-07-251-6/+14
| | | | | | | diffing. This removes extra "struct"/"class" in the type names and gives "bool" instead of "_Bool" for booleans. llvm-svn: 213912
* Print "(default)" for default template template arguments to match theRichard Trieu2014-07-241-1/+22
| | | | | | printing of other types. llvm-svn: 213902
* Add support for nullptr template arguments to template type diffing.Richard Trieu2014-07-241-0/+54
| | | | llvm-svn: 213840
* When pretty-printing a declaration of a pack, put the ellipsis before the nameRichard Smith2014-07-231-0/+12
| | | | | | | | being declared, not at the end. When pretty-printing a non-type template parameter, put the name of the parameter in the middle of the type, not at the end. llvm-svn: 213718
* Fix '&' printing for template arguments in parentheses in template diffing.Richard Trieu2014-07-221-2/+6
| | | | llvm-svn: 213613
* More gracefully handle parentheses in templare arguments in template diffing.Richard Trieu2014-07-221-1/+5
| | | | llvm-svn: 213611
OpenPOWER on IntegriCloud