summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Fix a template diffing problem were an '&' is unexpectedly printed inRichard Trieu2014-07-221-0/+16
| | | | | | a template argument. llvm-svn: 213609
* PR20356: Fix all Sema warnings with mismatched ext_/warn_ versusRichard Smith2014-07-191-6/+4
| | | | | | | | ExtWarn/Warnings. Mostly the name of the warning was changed to match the semantics, but in the PR20356 cases, the warning was about valid code, so the diagnostic was changed from ExtWarn to Warning instead. llvm-svn: 213443
* clang/test/Misc/backend-optimization-failure.cpp: Appease to add -triple=x86_64.NAKAMURA Takumi2014-07-191-1/+2
| | | | | FIXME: Could this be made generic? llvm-svn: 213441
* Recommit: Handle diagnostic warnings in Frontend diagnostic handler.Tyler Nowicki2014-07-181-0/+20
| | | | | | | | | | | | | | | Clang uses a diagnostic handler to grab diagnostic messages so it can print them with the line of source code they refer to. This patch extends this to handle optimization failures that were added to llvm to produce a warning when loop vectorization is explicitly specified (using a pragma clang loop directive) but fails. Update renames warning flag name to avoid indicating the flag's severity and adds a test. Reviewed by Alp Toker llvm-svn: 213400
* Revert "clang/test/Driver/crash-report.c: This requires rewriter for ↵Alp Toker2014-07-162-2/+0
| | | | | | | | | | | | | | | | | | | | | -frewrite-includes. [PR20321]" We've decided to make the core rewriter class and PP rewriters mandatory. They're only a few hundred lines of code in total and not worth supporting as a distinct build configuration, especially since doing so disables key compiler features. This reverts commit r213150. Revert "clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter." This reverts commit r213148. Revert "Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/" This reverts commit r213146. llvm-svn: 213159
* clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter.NAKAMURA Takumi2014-07-162-0/+2
| | | | llvm-svn: 213148
* Driver: bifurcate extended and basic MSC versioningSaleem Abdulrasool2014-07-161-8/+12
| | | | | | | | | | | | | | | | | | | | | | | This restores the original behaviour of -fmsc-version. The older option remains as a mechanism for specifying the basic version information. A secondary option, -fms-compatibility-version permits the user to specify an extended version to the driver. The new version takes the value as a dot-separated value rather than the major * 100 + minor format that -fmsc-version format. This makes it easier to specify the value as well as a more flexible manner for specifying the value. Specifying both values is considered an error. The older parameter is left solely as a driver option, which is normalised into the newer parameter. This allows us to retain a single code path in the compiler itself whilst preserving the semantics of the old parameter as well as avoid having to determine which of two formats are being used by the invocation. The test changes are due to the fact that the compiler no longer supports the old option, and is a direct conversion to the new option. llvm-svn: 213119
* Add AST dumping for VarDecl init kind.Richard Smith2014-07-101-4/+4
| | | | llvm-svn: 212774
* Prevent link warnings due to -Wframe-larger-than=Alp Toker2014-07-101-0/+4
| | | | | | | | | | | | | | | | | | | Although this is nominally a -W option, we actually handle it in the driver exactly as an f-group flag that's translated directly to -mllvm. That means f_Group (and unintuitively, not W_Group) has the semantics we want to make it behave like a standard warning flag: no automatic forwarding, no warning for link invocations and compile-only. Silences diagnostics like: [691/1545] Linking CXX executable bin/llvm-diff clang-3.5: warning: argument unused during compilation: '-Wframe-larger-than=2048' (Hopefully we can move towards handling these in the frontend but that'll require some infrastructure work.) llvm-svn: 212670
* PR15677 - Crash in template diffing. Check that expression is evaluatable ↵Nikola Smiljanic2014-07-011-0/+37
| | | | | | before evaluating it. llvm-svn: 212090
* Fix/Improve SourceRange of explicitly defaulted membersDaniel Jasper2014-06-201-0/+25
| | | | | | | | | | | | | | | | When adding the implicit compound statement (required for Codegen?), the end location was previously overridden by the start location, probably based on the assumptions: * The location of the compound statement should be the member's location * The compound statement if present is the last element of a FunctionDecl This patch changes the location of the compound statement to the member's end location. Code review: http://reviews.llvm.org/D4175 llvm-svn: 211344
* Sema: Static redeclaration after extern declarations is a Microsoft ExtensionDavid Majnemer2014-06-181-2/+1
| | | | | | | | | | | CL permits static redeclarations to follow extern declarations. The storage specifier on the latter declaration has no effect. This fixes PR20034. Differential Revision: http://reviews.llvm.org/D4149 llvm-svn: 211238
OpenPOWER on IntegriCloud