summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc
Commit message (Collapse)AuthorAgeFilesLines
* Put ext_implicit_lib_function_decl in ImplicitFunctionDeclare.Ed Schouten2015-09-041-2/+1
| | | | | | | | | | | | | | If we build with -Werror=implicit-function-declaration, only implicit function declarations of non-library functions throw compiler errors. For library functions, we only produce a warning. There is no way to promote both of these cases to an error without promoting other warnings. It makes little sense to introduce an additional compiler flag just to control this specific warning. In my opinion it should just be part of the same group. llvm-svn: 246857
* Fix macro backtrace printing.Richard Trieu2015-08-271-0/+50
| | | | | | | | Sometimes, a macro that expands to another macro name will not be printed in the macro backtrace. This patch finds the missed macro expansions and prints them. Fixes PR16799 llvm-svn: 246237
* Stop printing macro backtraces that don't help diagnostics.Richard Trieu2015-08-123-6/+80
| | | | | | | | | | | | | | | When displaying the macro backtrace, ignore some of the backtraces that do not provide extra information to the diagnostic. Typically, if the problem is entirely contained within a macro argument, the macro expansion is often not needed. Also take into account SourceRange's attached to the diagnostic when selecting which backtraces to ignore. Two previous test cases have also been updated. Patch by Zhengkai Wu, with minor formatting fixes. Differential Revision: http://reviews.llvm.org/D11778 llvm-svn: 244788
* [Frontend] Fix crash when serializing diagnostics with really long text.Argyrios Kyrtzidis2015-08-061-0/+30
| | | | | | rdar://21896690 llvm-svn: 244245
* [modules] Add an assert for redeclarations that we never added to their redeclRichard Smith2015-07-271-1/+1
| | | | | | | | | | | | | | | chain and fix the cases where it fires. * Handle the __va_list_tag as a predefined decl. Previously we failed to merge sometimes it because it's not visible to name lookup. (In passing, remove redundant __va_list_tag typedefs that we were creating for some ABIs. These didn't affect the mangling or representation of the type.) * For Decls derived from Redeclarable that are not in fact redeclarable (implicit params, function params, ObjC type parameters), remove them from the list of expected redeclarable decls. llvm-svn: 243259
* Fix the cc1as crash when it outputs assemblySteven Wu2015-07-241-0/+3
| | | | | | | | In clang cc1as_main, when the output file type is “asm”, AsmStreamer owns a formatted_raw_ostream which has a reference to FDOS (raw_ostream), so AsmStreamer must be closed before FDOS is closed. llvm-svn: 243085
* PR10405 - Desugar FunctionType and TemplateSpecializationType if any type ↵Nikola Smiljanic2015-07-161-0/+17
| | | | | | that appears inside needs to be desugared. llvm-svn: 242371
* Erase REQUIRES: shell-preserves-root from remaining tests, see r242312.þYaron Keren2015-07-151-4/+0
| | | | llvm-svn: 242323
* 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
OpenPOWER on IntegriCloud