summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/MicrosoftExtensions.c
Commit message (Collapse)AuthorAgeFilesLines
* Add support for the MS qualifiers __ptr32, __ptr64, __sptr, __uptr.Amy Huang2019-12-181-0/+14
| | | | | | | | | | | | | | | | | | | | Summary: This adds parsing of the qualifiers __ptr32, __ptr64, __sptr, and __uptr and lowers them to the corresponding address space pointer for 32-bit and 64-bit pointers. (32/64-bit pointers added in https://reviews.llvm.org/D69639) A large part of this patch is making these pointers ignore the address space when doing things like overloading and casting. https://bugs.llvm.org/show_bug.cgi?id=42359 Reviewers: rnk, rsmith Subscribers: jholewinski, jvesely, nhaehnle, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71039
* [ms] Add support for parsing uuid as a Microsoft attribute.Nico Weber2016-09-031-0/+2
| | | | | | | | | | | | | | | | | Some Windows SDK classes, for example Windows::Storage::Streams::IBufferByteAccess, use the ATL way of spelling attributes: [uuid("....")] class IBufferByteAccess {}; To be able to use __uuidof() to grab the uuid off these types, clang needs to support uuid as a Microsoft attribute. There was already code to skip Microsoft attributes, extend that to look for uuid and parse it. Use the new "Microsoft" attribute type added in r280575 (and r280574, r280576) for this. Final part of https://reviews.llvm.org/D23895 llvm-svn: 280578
* [Sema] A flexible array member must not be the only named memberDavid Majnemer2016-07-041-0/+6
| | | | | | | | | We didn't correctly detect situations where a flexible array member was the only named member in a record. This fixes PR28407. llvm-svn: 274477
* [MSVC] Support for __unaligned qualifier in functionsAndrey Bokhanko2016-05-261-0/+2
| | | | | | | | | | | | | | | This implements support for MS-specific __unaligned qualifier in functions and makes the following test case both compile and mangle correctly: struct S { void f() __unaligned; }; void S::f() __unaligned { } Differential Revision: http://reviews.llvm.org/D20437 llvm-svn: 270834
* [MSVC] Implementation of __unaligned as a proper type qualifierAndrey Bokhanko2016-05-111-0/+8
| | | | | | | | | | | This patch implements __unaligned (MS extension) as a proper type qualifier (before that, it was implemented as an ignored attribute). It also fixes PR27367 and PR27666. Differential Revision: http://reviews.llvm.org/D20103 llvm-svn: 269220
* Revert r268727, it caused PR27666.Nico Weber2016-05-061-8/+0
| | | | llvm-svn: 268736
* [MSVC] Implementation of __unaligned as a proper type qualifierAndrey Bokhanko2016-05-061-0/+8
| | | | | | | | | | | This patch implements __unaligned (MS extension) as a proper type qualifier (before that, it was implemented as an ignored attribute). It also fixes PR27367. Differential Revision: http://reviews.llvm.org/D19654 llvm-svn: 268727
* Revert r266415, it broke parsing SDK headers (PR27367).Nico Weber2016-04-151-8/+0
| | | | llvm-svn: 266431
* [MSVC Compat] Implementation of __unaligned (MS extension) as a type qualifierAndrey Bokhanko2016-04-151-0/+8
| | | | | | | | | | | This patch implements __unaligned as a type qualifier; before that, it was modeled as an attribute. Proper mangling of __unaligned is implemented as well. Some OpenCL code/tests are tangenially affected, as they relied on existing number and sizes of type qualifiers. Differential Revision: http://reviews.llvm.org/D18596 llvm-svn: 266415
* Sema: Diagnose undefined structs used as Microsoft anonymous structsDavid Majnemer2014-09-181-0/+8
| | | | | | | | | | | | | | | Previously, we would not mark structs containing anonymous structs as invalid. Later, horrific things would occur when trying to determine the size of the parent record. Instead, require the struct to be a complete type when used as an anonymous struct. Mark both the anonymous field for the struct and the parent context as invalid (this is similar to what we do when a struct contains a field with an incomplete type.) This fixes PR11847. llvm-svn: 218006
* revert patch r216469.Fariborz Jahanian2014-08-261-1/+1
| | | | llvm-svn: 216485
* c11- Check for c11 language option as documentation saysFariborz Jahanian2014-08-261-1/+1
| | | | | | | | feature is c11 about nested struct declarations must have struct-declarator-list. Without this change, code which was meant for c99 breaks. rdar://18125536 llvm-svn: 216469
* Sema: Properly perform lookup when acting on fields for desig initsDavid Majnemer2014-08-111-0/+2
| | | | | | | | | | | | | | | | | | | | Clang used a custom implementation of lookup when handling designated initializers. The custom code was not particularly optimized and relied on standard lookup for typo-correction anyway. This custom code has to go, it doesn't properly support MSVC-style anonymous structs embedded inside other records; replace it with the typo-correction path. This has the side effect of speeding up semantic handling of the fields for a designated initializer while simplifying the code at the same time. This fixes PR20573. Differential Revision: http://reviews.llvm.org/D4839 llvm-svn: 215372
* Sema: Handle declspecs without declarators in records properly in C modeDavid Majnemer2014-08-111-0/+15
| | | | | | | | | | | | | | | | | | | | | We had two bugs: - We wouldn't properly warn when a struct/union/enum was mentioned inside of a record definition if no declarator was provided. We should have mentioned that this declaration declares nothing. - We didn't properly support Microsoft's extension where certain declspecs without declarators would act as anonymous structs/unions. * We completely ignored the case where such a declspec could be a union. * We didn't properly handle the case where a record was defined inside another record: struct X { int a; struct Y { int b; }; }; llvm-svn: 215347
* test: add an explicit target tripleSaleem Abdulrasool2014-07-231-1/+1
| | | | | | | Now that we support WoA, this test fails on ARM build bots as __va_start has a different signature on different architectures. llvm-svn: 213714
* Try to fix arm bots by removing a superfluous __cdeclReid Kleckner2014-03-261-1/+1
| | | | llvm-svn: 204872
* -fms-extensions: Add __va_start builtin, which is used for x64Reid Kleckner2014-03-261-0/+14
| | | | | | | | | | The main difference between __va_start and __builtin_va_start is that the address of the va_list has already been taken, and the va_list is always a char*. __va_end and __va_arg are not needed. llvm-svn: 204821
* Implemented delayed processing of 'unavailable' checking, just like with ↵Ted Kremenek2013-12-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | 'deprecated'. Fixes <rdar://problem/15584219> and <rdar://problem/12241361>. This change looks large, but all it does is reuse and consolidate the delayed diagnostic logic for deprecation warnings with unavailability warnings. By doing so, it showed various inconsistencies between the diagnostics, which were close, but not consistent. It also revealed some missing "note:"'s in the deprecated diagnostics that were showing up in the unavailable diagnostics, etc. This change also changes the wording of the core deprecation diagnostics. Instead of saying "function has been explicitly marked deprecated" we now saw "'X' has been been explicitly marked deprecated". It turns out providing a bit more context is useful, and often we got the actual term wrong or it was not very precise (e.g., "function" instead of "destructor"). By just saying the name of the thing that is deprecated/deleted/unavailable we define this issue away. This diagnostic can likely be further wordsmithed to be shorter. llvm-svn: 197627
* __declspec(uuid) is only supported for C++ code according to MSDN (as well ↵Aaron Ballman2013-11-241-4/+1
| | | | | | as behaviorally in MSVC). This adds a generic diagnostic that we use for uuid, and can use for some other attributes as well, and adds a testcase. llvm-svn: 195580
* err_attribute_not_string has been subsumed by err_attribute_argument_type.Aaron Ballman2013-07-301-1/+1
| | | | llvm-svn: 187400
* Removed a parameter from handleAttrWithMessage to make it more consistent ↵Aaron Ballman2013-07-181-1/+1
| | | | | | with other attribute handlers, as well as other attribute error messages. Added missing test cases for the unavailable attribute, and updated the deprecated test case. llvm-svn: 186578
* Disallow reinterpret_cast from pointer to bool on WindowsHans Wennborg2013-06-061-0/+3
| | | | | | | | | | | | This became allowed by accident in r131201, but triggers an assert. That patch added an exception to allow conversion from pointers to narrow integral types for MSVC compatibility. However, a pointer can already be converted to bool in a civilized manner; allowing conversion via reinterpret_cast is a bad idea. Fixes PR16222. llvm-svn: 183394
* Adding in parsing and the start of semantic support for __sptr and __uptr ↵Aaron Ballman2013-05-221-0/+29
| | | | | | | | | | pointer type qualifiers. This patch also fixes the correlated __ptr32 and __ptr64 pointer qualifiers so that they are truly type attributes instead of declaration attributes. For more information about __sptr and __uptr, see MSDN: http://msdn.microsoft.com/en-us/library/aa983399.aspx Patch reviewed by Richard Smith. llvm-svn: 182535
* Unify the codepaths for emitting deprecation warnings. The test changes are ↵Eli Friedman2012-08-081-1/+1
| | | | | | just to account for us emitting notes more consistently. llvm-svn: 161528
* Reapplying the changes from r158717 as they were rolled back to avoid merge ↵Aaron Ballman2012-06-191-0/+2
| | | | | | conflicts from a separate problematic patch. llvm-svn: 158750
* Revert r158700 and dependent patches r158716, r158717, and r158731.Jakob Stoklund Olesen2012-06-191-2/+0
| | | | | | | | 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-0/+2
| | | | | | includes support for the align (which fixes PR12631). llvm-svn: 158717
* with -Wdeprecated, include a note to its deprecated declarationFariborz Jahanian2012-04-231-2/+2
| | | | | | location. // rdar://10893232 llvm-svn: 155385
* Turned on support for __declspec(deprecated) in MS compatibility mode.Aaron Ballman2012-02-231-0/+14
| | | | llvm-svn: 151225
* Shift Microsoft enum extensions from -fms-extensions to -fms-compatibility, ↵Eli Friedman2012-02-161-10/+0
| | | | | | so -fms-extensions doesn't affect enum semantics in incompatible ways. <rdar://problem/10657186>. llvm-svn: 150663
* Fix crash on invalid in microsoft anonymous struct extension.Nico Weber2012-02-011-1/+10
| | | | | | Fixes PR11847. Patch from Jason Haslam! llvm-svn: 149460
* Add a Microsoft C test following r131201.Francois Pichet2011-05-111-0/+8
| | | | llvm-svn: 131202
* We need a longer long when testing this pathe Microsoft ↵Douglas Gregor2011-02-221-1/+1
| | | | | | fixed-underlying-type extension for enumeration types llvm-svn: 126250
* Enable enumeration types with a fixed underlying type, e.g.,Douglas Gregor2011-02-221-0/+12
| | | | | | | | | enum X : long { Value = 0x100000000 }; when in Microsoft-extension mode (-fms-extensions). This (now C++0x) feature has been supported since Microsoft Visual Studio .NET 2003. llvm-svn: 126243
* Microsoft C anonymous struct implementation.Francois Pichet2010-11-231-4/+40
| | | | | | Documentation: http://msdn.microsoft.com/en-us/library/z2cx9y4f.aspx llvm-svn: 120000
* Microsoft enum extensions. 2 things will change on -fms-extensions:Francois Pichet2010-10-181-0/+12
| | | | | | | 1. enum underlying type is int by default. 2. Error "enumerator value is not representable in the underlying type"is a ExtWarning llvm-svn: 116704
* Remove hard CRLF end-of-line markers from two files. These should be addedChandler Carruth2010-10-061-21/+21
| | | | | | | automatically when syncing due to the auto-props selecting svn:eol-style of 'native'. llvm-svn: 115758
* Microsoft's flexible array rules relaxation:Francois Pichet2010-09-151-0/+21
- in union - as the only element of a struct/class. llvm-svn: 113909
OpenPOWER on IntegriCloud