llvm-project/clang/lib/Sema
John McCall 95833f33bd Diagnose attempts to apply ms_struct to records with base classes
or virtual functions, but permit that error to be downgraded to
a warning (with -Wno-error=incompatible-ms-struct), and officially
support this kind of dual, ABI-mixing layout.

The basic problem here is that projects which use ms_struct are often
not very circumspect about what types they annotate; for example,
some projects enable the pragma in a prefix header and then only
selectively disable it around system header inclusions.  They may
only care about binary compatibility with MSVC for a subset of
those structs, but that doesn't mean they have no binary
compatibility concerns at all for the rest; thus we are essentially
forced into supporting this hybrid ABI.  But it's reasonable for
us to at least point out the places where we're not making
any guarantees.

The original diagnostic was for dynamic classes, i.e. those with
virtual functions or virtual bases; I've extended it to include
all classes with bases, because we are not actually making any
attempt to duplicate MSVC's base subobject layout in ms_struct
(and it is indeed quite different from Itanium, even for
non-virtual bases).

rdar://16178895

llvm-svn: 202427
2014-02-27 20:30:49 +00:00
..
AnalysisBasedWarnings.cpp As of r202325, CFGBlock predecessors may be NULL. Ignore such preds. Fixes a crasher, PR18983. 2014-02-27 02:43:25 +00:00
AttributeList.cpp Add a new attribute meta-spelling called "GCC" -- it widens into being a GNU spelling, and a CXX11 spelling with the namespace "gnu". It also sets a bit on the spelling certifying that it is known to GCC. From this, we can warn about the extension appropriately. As a consequence, the FunctionDefinition functionality is completely removed. 2014-01-27 22:10:04 +00:00
CMakeLists.txt [CMake] Use LINK_LIBS instead of target_link_libraries(). 2014-02-26 06:41:29 +00:00
CodeCompleteConsumer.cpp Allow the computation of the base priority for a declaration code completion result to consider the completion context 2013-01-31 04:52:16 +00:00
DeclSpec.cpp argument -> parameter terminology fixes for FunctionTypeInfo 2014-02-26 22:27:52 +00:00
DelayedDiagnostic.cpp Implemented delayed processing of 'unavailable' checking, just like with 'deprecated'. 2013-12-18 23:30:06 +00:00
IdentifierResolver.cpp Per [dcl.meaning]p1, a name in an inline namespace can be redeclared using a 2013-12-05 04:30:04 +00:00
JumpDiagnostics.cpp Rename language option MicrosoftMode to MSVCCompat 2014-01-14 12:51:41 +00:00
Makefile
MultiplexExternalSemaSource.cpp Add hooks to ExternalSemaSource for after-the-fact diagnosis of 2013-08-12 22:11:14 +00:00
Scope.cpp Fix to PR8880 (clang dies processing a for loop) 2014-01-23 15:05:00 +00:00
ScopeInfo.cpp [REFACTOR] Refactored some of the generic-lambda capturing code. 2013-12-07 20:22:44 +00:00
Sema.cpp Follow up to r201927: remove the Sema::InFunctionDeclarator field. 2014-02-24 20:45:14 +00:00
SemaAccess.cpp Move the -fms-compatibility using decl check after real access checking 2014-02-08 02:40:20 +00:00
SemaAttr.cpp MS ABI: Implement #pragma vtordisp() and clang-cl /vdN 2014-02-12 23:50:26 +00:00
SemaCXXScopeSpec.cpp Improve diagnostic for using non-class/namespace/scoped enum in a nested name specifier. 2014-02-09 06:54:23 +00:00
SemaCast.cpp MS ABI: Tweak pointer-to-member mangling/inheritance model selection 2014-02-06 10:59:19 +00:00
SemaChecking.cpp PR16074, implement warnings to catch pointer to boolean true and pointer to 2014-02-26 02:36:06 +00:00
SemaCodeComplete.cpp [code-completion] Style guideline for Cocoa has custom accessor in property declarations without spaces around '='. 2014-02-20 07:55:15 +00:00
SemaConsumer.cpp Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:48:34 +00:00
SemaDecl.cpp argument -> parameter terminology fixes for FunctionTypeInfo 2014-02-26 22:27:52 +00:00
SemaDeclAttr.cpp Sema: Definition of dllimport globals is not allowed 2014-02-26 21:27:13 +00:00
SemaDeclCXX.cpp Diagnose attempts to apply ms_struct to records with base classes 2014-02-27 20:30:49 +00:00
SemaDeclObjC.cpp [ObjC] Change default property synthesis logic to not completely skip DiagnoseUnimplementedProperties. 2014-02-21 19:41:34 +00:00
SemaExceptionSpec.cpp PR16638, DR1552: the exception specification on an implicitly-declared 2014-02-07 22:51:16 +00:00
SemaExpr.cpp PR16074, implement warnings to catch pointer to boolean true and pointer to 2014-02-26 02:36:06 +00:00
SemaExprCXX.cpp PR18876: The special-case rule that ignores the destruction of a top-level 2014-02-18 03:51:47 +00:00
SemaExprMember.cpp PR12788: Remove unnecessary and incorrect special case for indirect fields. 2014-01-17 22:29:43 +00:00
SemaExprObjC.cpp Sema: When merging objc string literals, give the result a constant array type. 2014-02-25 12:26:20 +00:00
SemaFixItUtils.cpp PR17290: Use 'false' macro in fix-it hint for initializing a variable of type 2013-09-20 00:27:40 +00:00
SemaInit.cpp Correctly set brace range for CXXConstructExprs formed by list initialization. 2014-02-22 02:59:41 +00:00
SemaLambda.cpp argument -> parameter terminology fixes for FunctionTypeInfo 2014-02-26 22:27:52 +00:00
SemaLookup.cpp PR18685: Ignore class template specializations as potential 2014-02-09 21:47:04 +00:00
SemaObjCProperty.cpp Remove dead assignment reported by Gautier DI FOLCO. 2014-02-25 05:58:54 +00:00
SemaOpenMP.cpp [OPENMP] First changes for Parsing and Sema for 'omp simd' directive support 2014-02-27 08:29:12 +00:00
SemaOverload.cpp Tighten lax vector-conversion rules and enforce them consistently. 2014-02-04 23:58:19 +00:00
SemaPseudoObject.cpp Rename getResultType() on function and method declarations to getReturnType() 2014-01-25 16:55:45 +00:00
SemaStmt.cpp Rename getResultLoc() too 2014-01-25 23:51:36 +00:00
SemaStmtAsm.cpp [ms-inline asm] Don't diagnose an empty lookup for inline assmebly. This happen 2013-05-24 18:32:55 +00:00
SemaStmtAttr.cpp Distinguish between attributes explicitly written at the request of the user, and attributes implicitly generated to assist in bookkeeping by the compiler. This is done so by table generating a CreateImplicit method for each attribute. 2014-01-16 13:03:14 +00:00
SemaTemplate.cpp Remove accidentally-committed debugging statement. Thanks to Faisal Vali for 2014-02-21 18:46:01 +00:00
SemaTemplateDeduction.cpp Rename getResultType() on function and method declarations to getReturnType() 2014-01-25 16:55:45 +00:00
SemaTemplateInstantiate.cpp Update FunctionTypeLoc and related names to match r199686 2014-01-21 00:32:38 +00:00
SemaTemplateInstantiateDecl.cpp Sema: Don't crash when trying to instantiate a local class with an invalid base specifier 2014-02-22 00:17:46 +00:00
SemaTemplateVariadic.cpp Sort all the #include lines with LLVM's utils/sort_includes.py which 2014-01-07 11:51:46 +00:00
SemaType.cpp argument -> parameter terminology fixes for FunctionTypeInfo 2014-02-26 22:27:52 +00:00
TreeTransform.h [OPENMP] First changes for Parsing and Sema for 'omp simd' directive support 2014-02-27 08:29:12 +00:00
TypeLocBuilder.cpp Add missing file from r183563 (the recommit of 183466). 2013-06-07 20:33:10 +00:00
TypeLocBuilder.h Re-commit r183466 with a fix to make the TypeLoc casting machinery work 2013-06-07 20:31:48 +00:00