summaryrefslogtreecommitdiffstats
path: root/test/Misc/warning-flags.c
Commit message (Collapse)AuthorAgeFilesLines
* Add warning flag for '#import is a language extension', -W#import-pedantic.Ted Kremenek2012-03-161-2/+1
| | | | | | | Don't know if it is an anathema to include '#' in the warning name. I'm fine with changing it, but this was the most obvious name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152886 91177308-0d34-0410-b5e6-96231b3b80d8
* Move int<->pointer conversion warnings behind -Wint-conversions.Nico Weber2012-03-021-3/+1
| | | | | | | | | This is consistent with -Wbool-conversion. Let me know if you prefer a different flag name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151934 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r151638 and r151641.James Molloy2012-02-291-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug that was caught by Apple's internal buildbots was valid and also showed another bug in my implementation. These are now fixed, with regression tests added to catch them both (not Darwin-specific). Original log: ==================== Revert r151638 because it causes assertion hit on PCH creation for Cocoa.h Original log: --------------------- Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. --------------------- I also reverted r151641 which was enhancement on top of r151638. ==================== git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151712 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r151638 because it causes assertion hit on PCH creation for Cocoa.hArgyrios Kyrtzidis2012-02-281-1/+2
| | | | | | | | | | | | | | | | | | | | Original log: --------------------- Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. --------------------- I also reverted r151641 which was enhancement on top of r151638. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151667 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly track tags and enum members defined in the prototype of a ↵James Molloy2012-02-281-2/+1
| | | | | | | | | | | | | | | | | function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151638 91177308-0d34-0410-b5e6-96231b3b80d8
* Support GCC's bug^Wextension allowing class array members to be initalized by aRichard Smith2012-02-151-2/+1
| | | | | | | parenthesized braced-init-list in the base/member initialization list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150625 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused diagnostics from include/clang/Basic/Diagnostic*.td files.Dmitri Gribenko2012-02-131-9/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150409 91177308-0d34-0410-b5e6-96231b3b80d8
* Pedantic diagnostic correction: in C++, we have integral constant expressions,Richard Smith2012-01-151-2/+1
| | | | | | | | | not integer constant expressions. In passing, fix the 'folding is an extension' diagnostic to not claim we're accepting the code, since that's not true in -pedantic-errors mode, and add this diagnostic to -Wgnu. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148209 91177308-0d34-0410-b5e6-96231b3b80d8
* PR10828: Produce a warning when a no-arguments function is declared in blockRichard Smith2012-01-051-2/+1
| | | | | | | | | | | | | | | | | | scope, when no other indication is provided that the user intended to declare a function rather than a variable. Remove some false positives from the existing 'parentheses disambiguated as a function' warning by suppressing it when the declaration is marked as 'typedef' or 'extern'. Add a new warning group -Wvexing-parse containing both of these warnings. The new warning is enabled by default; despite a number of false positives (and one bug) in clang's test-suite, I have only found genuine bugs with it when running it over a significant quantity of real C++ code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147599 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the diagnostics which said 'accepted as an extension' to instead sayRichard Smith2011-12-291-2/+1
| | | | | | | | 'is an extension'. The former is inappropriate and confusing when building with -Werror/-pedantic-errors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147357 91177308-0d34-0410-b5e6-96231b3b80d8
* Let the KNR promotion warning be disabled.Roman Divacky2011-12-201-2/+1
| | | | | | | | Patch by Dimitry Andric! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146982 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a warning flag for ext_embedded_directive. gcc considers this undefinedRichard Smith2011-12-161-2/+1
| | | | | | | | behaviour to be an error, so it's useful to be able to make it an error in clang too. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146755 91177308-0d34-0410-b5e6-96231b3b80d8
* Suggest typo corrections for implicit function declarations.Hans Wennborg2011-12-061-2/+1
| | | | | | | A mistyped function call becomes an inmplicit function declaration in C. Suggest typo correction when one can be found. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145930 91177308-0d34-0410-b5e6-96231b3b80d8
* Place "use @dynamic or provide a method implementation" warnings under a -W ↵Ted Kremenek2011-11-291-3/+1
| | | | | | flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145418 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove one group'ed warning.Fariborz Jahanian2011-11-151-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144678 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the signature of the getcontext builtin. Patch by Dimitry Andric.Rafael Espindola2011-11-131-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144505 91177308-0d34-0410-b5e6-96231b3b80d8
* Place 'argument unused during compilation' under a -W flag. Fixes ↵Ted Kremenek2011-11-111-2/+1
| | | | | | <rdar://problem/10403653>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144365 91177308-0d34-0410-b5e6-96231b3b80d8
* Put ext_offsetof_extended_field_designator under the warning flagDouglas Gregor2011-11-091-2/+1
| | | | | | | -Wextended-offsetof, from Jeff Walden! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144160 91177308-0d34-0410-b5e6-96231b3b80d8
* Move about 20 random diagnostics under -W flags. Patch by Ahmed Charles!Ted Kremenek2011-10-171-19/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142284 91177308-0d34-0410-b5e6-96231b3b80d8
* Add flags for the remaining shift related warningsJoerg Sonnenberger2011-10-141-3/+1
| | | | | | | (-Wshift-count-negative, -Wshift-count-overflow). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141962 91177308-0d34-0410-b5e6-96231b3b80d8
* Place diagnostic group ext_typecheck_decl_incomplete_type under a -W flag.Ted Kremenek2011-10-111-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141620 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -Wlanguage-extension-token option for ext_token_used warning.Ivan Krasin2011-10-061-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141268 91177308-0d34-0410-b5e6-96231b3b80d8
* Place diagnostic warn_atomic_property_rule under a -W flag. Fixes ↵Ted Kremenek2011-10-041-2/+1
| | | | | | <rdar://problem/10230631>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141089 91177308-0d34-0410-b5e6-96231b3b80d8
* Place diagnostic warn_ownin_getter_rule under a -W flag. Fixes ↵Ted Kremenek2011-10-041-2/+1
| | | | | | <rdar://problem/10230626>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141088 91177308-0d34-0410-b5e6-96231b3b80d8
* Place diagnostic ext_predef_outside_function under a -W flag. Fixes ↵Ted Kremenek2011-10-041-2/+1
| | | | | | <rdar://problem/10226192>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141087 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r141060. We should NEVER add new warnings that aren't guarded by flag.Ted Kremenek2011-10-041-2/+1
| | | | | | This reverts commit 5383d065241b18e84232bc50d81523f2058ea62b. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141077 91177308-0d34-0410-b5e6-96231b3b80d8
* Update testcase for r141053+r141055.Chad Rosier2011-10-041-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141060 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a warning group for warnings about using C1X features as extensionsPeter Collingbourne2011-09-291-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140795 91177308-0d34-0410-b5e6-96231b3b80d8
* Add DiagGroups to a couple of warnings.Matt Beaumont-Gay2011-09-231-5/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140411 91177308-0d34-0410-b5e6-96231b3b80d8
* Place diagnostic warn_ivar_use_hidden under the flag -Wshadow-ivar.Ted Kremenek2011-09-221-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140329 91177308-0d34-0410-b5e6-96231b3b80d8
* PR10458: Finesse behaviour of C++0x features when in pre-0x mode. Accept ↵Richard Smith2011-09-041-1/+1
| | | | | | for-range and auto with an ExtWarn, and produce a -Wc++0x-compat warning in C++98 mode when auto is used as a storage class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139102 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the "no module found" default-fatal warning to a default-fatal error.Douglas Gregor2011-08-311-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138909 91177308-0d34-0410-b5e6-96231b3b80d8
* Change err_pp_file_not_found back to an Error; when it's a Warning, we ↵Eli Friedman2011-08-301-2/+1
| | | | | | | | | | suppress it in system headers. And it is not a good idea to suppress it in system headers. (This was originally changed in r134996 to implement -MG.) Fixes <rdar://10041960>. And also brings down the number of warnings without a flag by one :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138842 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce support for a simple module import declaration, whichDouglas Gregor2011-08-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | loads the named module. The syntax itself is intentionally hideous and will be replaced at some later point with something more palatable. For now, we're focusing on the semantics: - Module imports are handled first by the preprocessor (to get macro definitions) and then the same tokens are also handled by the parser (to get declarations). If both happen (as in normal compilation), the second one is redundant, because we currently have no way to hide macros or declarations when loading a module. Chris gets credit for this mad-but-workable scheme. - The Preprocessor now holds on to a reference to a module loader, which is responsible for loading named modules. CompilerInstance is the only important module loader: it now knows how to create and wire up an AST reader on demand to actually perform the module load. - We search for modules in the include path, using the module name with the suffix ".pcm" (precompiled module) for the file name. This is a temporary hack; we hope to improve the situation in the future. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138679 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix this test which had encoded the typo fixed in r137814.Chandler Carruth2011-08-171-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137821 91177308-0d34-0410-b5e6-96231b3b80d8
* Place err_cfstring_literal_not_string_constant and warn_cfstring_truncated ↵Ted Kremenek2011-08-121-2/+1
| | | | | | under "-WCFString" flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137508 91177308-0d34-0410-b5e6-96231b3b80d8
* Place diagnostic warn_stringcompare under the "-Wstring-compare" flag.Ted Kremenek2011-08-121-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137507 91177308-0d34-0410-b5e6-96231b3b80d8
* Place warnings related to incorrect "main()" declaration under "-Wmain".Ted Kremenek2011-08-121-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137506 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -Wtypename-missing flag for diagnostic warn_typename_missing.Ted Kremenek2011-08-121-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137505 91177308-0d34-0410-b5e6-96231b3b80d8
* Add diagtool-based test where we enforce that no additional warnings can be ↵Ted Kremenek2011-08-111-0/+337
added to Clang without a -W flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137369 91177308-0d34-0410-b5e6-96231b3b80d8