summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/MicrosoftCompatibility.c
Commit message (Collapse)AuthorAgeFilesLines
* Emit -Wmicrosoft-enum-value warning instead of error in MS ABIReid Kleckner2019-09-111-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The first NFC change is to replace a getCXXABI().isMicrosoft() check with getTriple().isWindowsMSVCEnvironment(). This code takes effect in non-C++ compilations, so it doesn't make sense to check the C++ ABI. In the MS ABI, enums are always considered to be "complete" because the underlying type of an unfixed enum will always be 'int'. This behavior was moved from -fms-compatibility to MS ABI back in r249656. The second change is functional, and it downgrades an error to a warning when the MS ABI is used rather than only under -fms-compatibility. The reasoning is that it's unreasonable for the following code to reject the following code for all MS ABI targets with -fno-ms-compatibility: enum Foo { Foo_Val = 0xDEADBEEF }; This is valid code for any other target, but in the MS ABI, Foo_Val just happens to be negative. With this change, clang emits a -Wmicrosoft-enum-value warning on this code, but compiles it without error. Fixes PR38478 Reviewers: hans, rsmith, STL_MSFT Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67304 llvm-svn: 371581
* [Sema] The alignment of an object has an upper bound from the object file formatDavid Majnemer2015-07-261-1/+1
| | | | | | | Don't use the spelling of the alignment attribute to determine whether or not an alignment amount makes sense. llvm-svn: 243233
* Sema: size_t is available in C when -fms-compatibility is enabledDavid Majnemer2015-02-181-0/+2
| | | | llvm-svn: 229616
* Unify __declspec attribute argument parsing with the common attribute ↵Aaron Ballman2014-03-311-2/+2
| | | | | | | | argument parsing code. This removes a diagnostic that is no longer required (the semantic engine now properly handles attribute syntax so __declspec and __attribute__ spellings no longer get mismatched). This caused several testcases to need updating for a slightly different wording. llvm-svn: 205234
* No longer accepting attribute spellings with prefix and suffix underscores ↵Aaron Ballman2013-12-111-0/+2
| | | | | | except for GNU attributes, or C++11-style attributes in the GNU namespace. This prevents attributes such as __declspec(__dllexport__) or [[__noreturn__]] from being treated as known attributes. llvm-svn: 197082
* Splitting this test case into two because the behavior for the calling ↵Aaron Ballman2012-10-021-6/+0
| | | | | | convention code is target-specific. llvm-svn: 165016
* Allowing individual targets to determine whether a given calling convention ↵Aaron Ballman2012-10-021-1/+7
| | | | | | | | is allowed or ignored with warning. This allows for correct name mangling for x64 targets on Windows, which in turn allows for linking against the Win32 APIs. Fixes PR13782 llvm-svn: 165015
* Reapplying the changes from r158717 as they were rolled back to avoid merge ↵Aaron Ballman2012-06-191-1/+6
| | | | | | conflicts from a separate problematic patch. llvm-svn: 158750
* Revert r158700 and dependent patches r158716, r158717, and r158731.Jakob Stoklund Olesen2012-06-191-6/+1
| | | | | | | | The original r158700 caused crashes in the gcc test suite, g++.abi/vtable3a.C among others. It also caused failures in the libc++ test suite. llvm-svn: 158749
* Improves parsing and semantic analysis for MS __declspec attributes. This ↵Aaron Ballman2012-06-191-1/+6
| | | | | | includes support for the align (which fixes PR12631). llvm-svn: 158717
* Turned on support for __declspecs: noreturn, noinline, nothrow and naked in ↵Aaron Ballman2012-02-231-0/+4
| | | | | | MS compatibility mode. llvm-svn: 151295
* Shift Microsoft enum extensions from -fms-extensions to -fms-compatibility, ↵Eli Friedman2012-02-161-0/+12
so -fms-extensions doesn't affect enum semantics in incompatible ways. <rdar://problem/10657186>. llvm-svn: 150663
OpenPOWER on IntegriCloud