summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/Inputs
Commit message (Collapse)AuthorAgeFilesLines
* [Diagnostic] Fix a warning typo. NFC.Matt Davis2018-09-121-1/+1
| | | | | | s/aligment/alignment/ llvm-svn: 342068
* PR36307: Consume the #pragma options align annotation token afterAlex Lorenz2018-02-081-0/+5
| | | | | | | | | semantic analysis to prevent incorrect -Wpragma-pack warning for an included file rdar://37354951 llvm-svn: 324651
* Recommit r308327 3rd time: Add a warning for missingAlex Lorenz2017-07-282-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files The second recommit (r309106) was reverted because the "non-default #pragma pack value chages the alignment of struct or union members in the included file" warning proved to be too aggressive for external projects like Chromium (https://bugs.chromium.org/p/chromium/issues/detail?id=749197). This recommit makes the problematic warning a non-default one, and gives it the -Wpragma-pack-suspicious-include warning option. The first recommit (r308441) caused a "non-default #pragma pack value might change the alignment of struct or union members in the included file" warning in LLVM itself. This recommit tweaks the added warning to avoid warnings for #includes that don't have any records that are affected by the non-default alignment. This tweak avoids the previously emitted warning in LLVM. Original message: This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 309386
* Revert r309106 "Recommit r308327 2nd time: Add a warning for missing"Hans Wennborg2017-07-262-35/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning fires on non-suspicious code in Chromium. Reverting until a solution is figured out. > Recommit r308327 2nd time: Add a warning for missing > '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files > > The first recommit (r308441) caused a "non-default #pragma pack value might > change the alignment of struct or union members in the included file" warning > in LLVM itself. This recommit tweaks the added warning to avoid warnings for > #includes that don't have any records that are affected by the non-default > alignment. This tweak avoids the previously emitted warning in LLVM. > > Original message: > > This commit adds a new -Wpragma-pack warning. It warns in the following cases: > > - When a translation unit is missing terminating #pragma pack (pop) directives. > - When entering an included file if the current alignment value as determined > by '#pragma pack' directives is different from the default alignment value. > - When leaving an included file that changed the state of the current alignment > value. > > rdar://10184173 > > Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 309186
* Recommit r308327 2nd time: Add a warning for missingAlex Lorenz2017-07-262-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files The first recommit (r308441) caused a "non-default #pragma pack value might change the alignment of struct or union members in the included file" warning in LLVM itself. This recommit tweaks the added warning to avoid warnings for #includes that don't have any records that are affected by the non-default alignment. This tweak avoids the previously emitted warning in LLVM. Original message: This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 309106
* Revert r308441 "Recommit r308327: Add a warning for missing '#pragma pack ↵Hans Wennborg2017-07-192-29/+0
| | | | | | | | | | | | | | | | | | | | | (pop)' and suspicious uses of '#pragma pack' in included files" This seems to have broken the sanitizer-x86_64-linux buildbot. Reverting until it's fixed, especially since this landed just before the 5.0 branch. > This commit adds a new -Wpragma-pack warning. It warns in the following cases: > > - When a translation unit is missing terminating #pragma pack (pop) directives. > - When entering an included file if the current alignment value as determined > by '#pragma pack' directives is different from the default alignment value. > - When leaving an included file that changed the state of the current alignment > value. > > rdar://10184173 > > Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 308455
* Recommit r308327: Add a warning for missing '#pragma pack (pop)'Alex Lorenz2017-07-192-0/+29
| | | | | | | | | | | | | | | | | | and suspicious uses of '#pragma pack' in included files This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 308441
* Revert r308327Alex Lorenz2017-07-182-29/+0
| | | | | | I forgot to test clang-tools-extra which is now failing. llvm-svn: 308328
* Add a warning for missing '#pragma pack (pop)' and suspicious usesAlex Lorenz2017-07-182-0/+29
| | | | | | | | | | | | | | | | | | of '#pragma pack' in included files This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 308327
* [clang] Emit `diagnose_if` warnings from system headersEric Fiselier2017-01-131-0/+11
| | | | | | | | | | | | Summary: In order for libc++ to meaningfully use `diagnose_if` warnings they need to be emitted from system headers by default. This patch changes the `diagnose_if` warning diagnostic to be shown in system headers. Reviewers: george.burgess.iv, rsmith, aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28703 llvm-svn: 291963
* Add test that -Wunreachable-code warnings are suppressed in headers.Ted Kremenek2014-02-211-0/+7
| | | | llvm-svn: 201893
* Make the -Wkeyword-compat diag message more accurateAlp Toker2013-12-091-1/+1
| | | | | | | | | | | | | | | | Changed from: keyword '__is_empty' will be treated as an identifier for the remainder of the translation unit To: keyword '__is_empty' will be made available as an identifier for the remainder of the translation unit This is a more accurate description of clang's keyword compatibility feature, given that some of the keywords are turned into context-sensitive keywords (e.g. REVERTIBLE_TYPE_TRAIT) rather than being fully disabled. llvm-svn: 196776
* Emit an extension warning when changing system header tokensAlp Toker2013-12-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | clang converts keywords to identifiers for compatibility with various system headers such as GNU libc. Implement a -Wkeyword-compat extension warning to diagnose those cases. The warning is on by default but will generally be ignored in system headers. It can however be enabled globally to aid standards conformance testing. This also changes the __uptr keyword avoidance from r195710 to no longer special-case system headers, bringing it in line with other similar workarounds in clang. Implementation returns bool for symmetry with token annotation functions. Some examples: warning: keyword '__is_pod' will be treated as an identifier for the remainder of the translation unit [-Wkeyword-compat] struct __is_pod warning: keyword '__uptr' will be treated as an identifier here [-Wkeyword-compat] union w *__uptr; llvm-svn: 196212
* Unbreak -fms-extensions with GNU libc headersAlp Toker2013-11-261-0/+6
| | | | | | | | | | | | | GNU libc uses '__uptr' as a member name in C mode, conflicting with the eponymous MSVC pointer modifier keyword. Detect and mark the token as an identifier when these specific conditions are met. __uptr will continue to work as a keyword for the remainder of the translation unit. Fixes PR17824. llvm-svn: 195710
* Add a test for r156092.Bob Wilson2012-05-031-0/+8
| | | | llvm-svn: 156132
* Suppress -Wunused-value within macros from system headers.Matt Beaumont-Gay2012-01-061-0/+23
| | | | | | | Along the way, move a helper function from SemaChecking.cpp to a more accessible home in SourceManager. llvm-svn: 147692
* Add explicit attributes to mark functions as having had theirJohn McCall2011-09-301-0/+16
| | | | | | | | | | | CoreFoundation object-transfer properties audited, and add a #pragma to cause them to be automatically applied to functions in a particular span of code. This has to be implemented largely in the preprocessor because of the requirement that the region be entirely contained in a single file; that's hard to impose from the parser without registering for a ton of callbacks. llvm-svn: 140846
* Track the location of the context requiring an implicit conversion and use itJohn McCall2010-10-081-0/+1
| | | | | | to white-list conversions required by system headers. rdar://problem/8232669 llvm-svn: 116029
* Make this test not rely on the system <limits.h>. Hopefully fixes theJohn McCall2010-02-111-0/+3
MSVC build. llvm-svn: 95932
OpenPOWER on IntegriCloud