summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc/warning-flags.c
Commit message (Collapse)AuthorAgeFilesLines
* Add warning flag for "partial specialization is not more specialized than ↵Richard Smith2016-12-271-2/+1
| | | | | | primary template" error (since Eigen hits it), and while I'm here also add a warning flag for "partial specialization is not usable because one or more of its parameters cannot be deduced" warning. llvm-svn: 290625
* Driver: Remove support for -fobjc-gc*Duncan P. N. Exon Smith2016-12-071-2/+1
| | | | | | | | | | | | As a first step toward removing Objective-C garbage collection from Clang, remove support from the driver. I'm hoping this will flush out any expected bots/configurations/whatever that might rely on it. I've left the options behind temporarily in -cc1 to keep tests passing. I'll kill them off entirely in a follow up when I've had a chance to update/delete the rest of Clang. llvm-svn: 288872
* More diagnostic name fixups: w_ -> warn_, warning_ -> warn_, not_ -> note_.Richard Smith2016-12-021-3/+1
| | | | | | In passing, add a warning group for "ignored qualifier in inline assembly" warnings. llvm-svn: 288548
* Add -Wduplicate-protocol for existing diagnosticAlex Lorenz2016-11-101-2/+1
| | | | | | | | | | | | | | Expose a warning flag for warn_duplicate_protocol_def. This allows control over the severity of duplicate protocol definitions. For example -Werror=duplicate-protocol or #pragma clang diagnostic ignored "-Wduplicate-protocol". Patch provided by Dave Lee! Differential Revision: https://reviews.llvm.org/D26406 llvm-svn: 286487
* DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.Richard Smith2016-10-211-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This has two significant effects: 1) Direct relational comparisons between null pointer constants (0 and nullopt) and pointers are now ill-formed. This was always the case for C, and it appears that C++ only ever permitted by accident. For instance, cases like nullptr < &a are now rejected. 2) Comparisons and conditional operators between differently-cv-qualified pointer types now work, and produce a composite type that both source pointer types can convert to (when possible). For instance, comparison between 'int **' and 'const int **' is now valid, and uses an intermediate type of 'const int *const *'. Clang previously supported #2 as an extension. We do not accept the cases in #1 as an extension. I've tested a fair amount of code to check that this doesn't break it, but if it turns out that someone is relying on this, we can easily add it back as an extension. This is a re-commit of r284800. llvm-svn: 284890
* Revert "DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' ↵Renato Golin2016-10-211-1/+2
| | | | | | | | rules." This reverts commit r284800, as it failed all ARM/AArch64 bots. llvm-svn: 284811
* DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.Richard Smith2016-10-211-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | This has two significant effects: 1) Direct relational comparisons between null pointer constants (0 and nullopt) and pointers are now ill-formed. This was always the case for C, and it appears that C++ only ever permitted by accident. For instance, cases like nullptr < &a are now rejected. 2) Comparisons and conditional operators between differently-cv-qualified pointer types now work, and produce a composite type that both source pointer types can convert to (when possible). For instance, comparison between 'int **' and 'const int **' is now valid, and uses an intermediate type of 'const int *const *'. Clang previously supported #2 as an extension. We do not accept the cases in #1 as an extension. I've tested a fair amount of code to check that this doesn't break it, but if it turns out that someone is relying on this, we can easily add it back as an extension. llvm-svn: 284800
* Put new warning in a diagnostic group.Matthias Braun2016-09-271-2/+1
| | | | | | The warning I added in r282426 should be a diagnostic group. llvm-svn: 282557
* CC1: Add -save-stats optionMatthias Braun2016-09-261-1/+2
| | | | | | | | | This option behaves in a similar spirit as -save-temps and writes internal llvm statistics in json format to a file. Differential Revision: https://reviews.llvm.org/D24820 llvm-svn: 282426
* Use %select to merge similar diagnostics. NFCCraig Topper2015-11-141-3/+2
| | | | llvm-svn: 253119
* Add warning flags for #include_next and some nearby warnings.Richard Smith2015-10-121-6/+2
| | | | llvm-svn: 250105
* Promote a warning on ill-formed code (redeclaration missing an exceptionRichard Smith2015-09-301-2/+1
| | | | | | | | | | | | | | | | | specification) to an error. No compiler other than Clang seems to allow this, and it doesn't seem like a useful thing to accept as an extension in general. The current behavior was added for PR5957, where the problem was specifically related to mismatches of the exception specification on the implicitly-declared global operator new and delete. To retain that workaround, we downgrade the error to an ExtWarn when the declaration is of a replaceable global allocation function. Now that this is an error, stop trying (and failing) to recover from a missing computed noexcept specification. That recovery didn't work, and led to crashes in code like the added testcase. llvm-svn: 248867
* C11 _Bool bitfield diagnosticRachel Craik2015-09-141-3/+1
| | | | | | | | | | | | Summary: Implement DR262 (for C). This patch will mainly affect bitfields of type _Bool Reviewers: fraggamuffin, rsmith Subscribers: hubert.reinterpretcast, cfe-commits Differential Revision: http://reviews.llvm.org/D10018 llvm-svn: 247618
* 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
* 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
* 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
* Objective-C. Provide group name for warningFariborz Jahanian2014-12-181-2/+1
| | | | | | | on multiple selector names found during lookup. rdar://19265296 llvm-svn: 224536
* Another warning with no group name bites the dust.Fariborz Jahanian2014-12-021-2/+1
| | | | | | rdar://19116886 llvm-svn: 223168
* Basic: Add ext_delete_void_ptr_operand to -Wdelete-incompleteDavid Majnemer2014-10-221-2/+1
| | | | | | This fixes PR21340. llvm-svn: 220442
* Objective-C [qoi] - provide group name forFariborz Jahanian2014-09-291-2/+1
| | | | | | warn_property_types_are_incompatible. rdar://18487506 llvm-svn: 218621
* 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
* Provide warning name for property attribute warningFariborz Jahanian2014-07-291-3/+1
| | | | | | mismatch. //rdar://17845264 llvm-svn: 214203
* 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
* 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
* ARCMT/GC-check-warn-nsalloc.m: don't provide a diag groupAlp Toker2014-05-191-1/+2
| | | | | | | This diagnostic is now controlled solely by -no-ns-alloc-error thus matching the original intended behaviour. llvm-svn: 209184
* Put macro redefinition warnings under -Wmacro-redefinedReid Kleckner2014-04-041-2/+1
| | | | | | | | | | | This is consistent with -Wbuiltin-macro-redefined, and puts this common extension warning under a flag. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D3283 llvm-svn: 205591
* Add two missing entries to the C++11 support page. Bump one relevant diagnosticRichard Smith2014-03-141-3/+1
| | | | | | | | (for an integer too large for any signed type) from Warning to ExtWarn -- it's ill-formed in C++11 and C99 onwards, and UB during translation in C89 and C++98. Add diagnostic groups for two relevant diagnostics. llvm-svn: 203974
* Basic: Add -Wswitch-bool to control warn_bool_switch_conditionDavid Majnemer2014-03-111-2/+1
| | | | | | | | This warning was missing a flag, add one. test/Misc/warning-flags.c has one fewer entry. llvm-svn: 203522
* Tests for DR370-380.Richard Smith2014-03-051-3/+1
| | | | | | | Also promote a couple of Warnings on ill-formed code found by this testing to ExtWarns. llvm-svn: 203021
* Basic: Clean up malformed pragma diagnosticsDavid Majnemer2014-02-101-23/+1
| | | | | | | Create a new diagnostic, -Wignored-pragmas and use it to handle any case where a pragma would have a side effect but is ignored. llvm-svn: 201102
* ARCMigrate: Introduce proper diagnostics for TransformActionsAlp Toker2014-01-261-1/+2
| | | | | | | | | | | | | | | This starts to switch ARCMT to use proper diagnostic messages. The old use was based on incorrect example code from the documentation. The logic of the previous report() functions has been retained to support any external consumers that might be intercepting diagnostic messages through the old interface. Note that the change in test/Misc/warning-flags.c isn't a new warning without a flag, rather one that was previously invisible to the test. Adding a flag might be a good idea though. llvm-svn: 200124
* This diagnostic did not accept arguments, and did not have any test ↵Aaron Ballman2013-12-261-2/+1
| | | | | | | | coverage. Parameterized the diagnostic, and made it more consistent with other attribute diagnostic wordings. Added test coverage. Since this warning was generalized, it was also given a sensible warning group flag and the corresponding test was updated to reflect this. llvm-svn: 198053
* Wordsmith "maybe" into "may be" in diagnostic, and move warning under flag.Ted Kremenek2013-12-191-2/+1
| | | | llvm-svn: 197736
* Rename an extension warning to ext_...Richard Smith2013-11-191-1/+1
| | | | llvm-svn: 195095
* Remove trailing spacesSylvestre Ledru2013-11-121-4/+4
| | | | llvm-svn: 194498
* Add specific warning flags for GNU ext in Sema.Eli Friedman2013-09-181-1/+1
| | | | | | | | | | | | | | | | | | | This patch adds the following, more specific warning flags: gnu-anonymous-struct gnu-compound-literal-initializer gnu-empty-struct gnu-flexible-array-initializer gnu-flexible-array-union-member gnu-folding-constant redeclared-class-member gnu-redeclared-enum gnu-union-cast gnu-variable-sized-type-not-at-end Patch by Peter Lewis. llvm-svn: 190972
* Tablegen now generates a StringSwitch for attributes containing enumeration ↵Aaron Ballman2013-09-111-2/+1
| | | | | | arguments to map strings to the proper enumeration value. This makes error checking more consistent and reduces the amount of hand-written code required. llvm-svn: 190545
* Add a diagnostic group for the "ignoring (static|inline) keyword onPeter Collingbourne2013-09-041-2/+1
| | | | | | explicit template instantiation" warning. llvm-svn: 189893
* Partially revert r186903.Eli Friedman2013-07-261-1/+2
| | | | | | | | 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
* Move friend warning into CXX11 warning group.Eli Friedman2013-07-261-2/+1
| | | | | | Also, fix the wording to reflect this. llvm-svn: 187171
* Integers which are too large should be an error.Eli Friedman2013-07-231-5/+1
| | | | | | | | 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
* Delete dead code.Eli Friedman2013-06-211-2/+1
| | | | llvm-svn: 184517
* Warn on va_start() when called with a reference parameter.Nico Weber2013-05-241-3/+1
| | | | | | | | | http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1905.pdf 18.7p3 explicitly calls this (and some other things) out as undefined. Also move 2 other existing warnings behind the new -Wvarargs flag. llvm-svn: 182694
* Add missing diagnostic for a nested-name-specifier on a free-standing type ↵Richard Smith2013-03-181-2/+1
| | | | | | definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations. llvm-svn: 177335
* After issuing a diagnostic for undefining or redefining a builtin macro,Richard Smith2013-03-061-2/+1
| | | | | | | | | continue parsing the directive rather than silently discarding it. Allowing undef or redef of __TIME__ and __DATE__ is important to folks who want stable, reproducible builds. llvm-svn: 176540
* Add missing InGroup for this warning.Nick Lewycky2013-01-251-2/+1
| | | | llvm-svn: 173429
* Give warn_redecl_library_builtin a flag name: ↵Nick Lewycky2013-01-241-2/+1
| | | | | | -Wincompatible-library-redeclaration. llvm-svn: 173319
* Fix code that attempted to produce a diagnostic with one DiagnosticEngine, thenRichard Smith2012-12-201-2/+1
| | | | | | | | produce a note for that diagnostic either with a different DiagnosticEngine or after calling DiagnosticEngine::Reset(). That didn't make any sense, and did the wrong thing if the original diagnostic was suppressed. llvm-svn: 170636
OpenPOWER on IntegriCloud