llvm-project/clang/lib
Richard Smith 2362829734 tl;dr: Teach Clang to work around g++ changing its workaround to glibc's
implementation of C99's attempt to control the C++ standard. *sigh*


The C99 standard says that certain macros in <stdint.h>, such as SIZE_MAX,
should not be defined when the header is included in C++ mode, unless
__STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS are defined. The C++11 standard
says "Thanks, but no thanks" and C11 removed this rule, but various C library
implementations (such as glibc) follow C99 anyway.

g++ prior to 4.8 worked around the C99 / glibc behavior by defining
__STDC_*_MACROS in <cstdint>, which was incorrect, because <stdint.h> is
supposed to provide these macros too. g++ 4.8 works around it by defining
__STDC_*_MACROS in its builtin <stdint.h> header.

This change makes Clang act like g++ 4.8 in this regard: our <stdint.h> now
countermands any attempt by the C library to implement the undesired C99 rules,
by defining the __STDC_*_MACROS first. Unlike g++, we do this even in C++98
mode, since that was the intent of the C++ committee, matches the behavior
required in C11, and matches our built-in implementation of <stdint.h>.

llvm-svn: 179419
2013-04-12 22:11:07 +00:00
..
ARCMigrate ARCMigrate/Transforms.h: Remove \arg in comment. [-Wdocumentation] 2013-04-11 04:16:11 +00:00
AST [ms-cxxabi] Implement member pointer emission and dereferencing 2013-04-11 18:13:19 +00:00
ASTMatchers Implements memoization for ancestor matching. 2013-03-14 16:33:21 +00:00
Analysis Thread safety analysis: turn on checking within lock and unlock functions. 2013-04-08 20:11:11 +00:00
Basic The PNaCl target no longer permits __attribute__((regparm)). 2013-04-08 21:31:01 +00:00
CodeGen Struct-path aware TBAA: uniformize scalar tag and path tag. 2013-04-11 23:02:56 +00:00
Driver Fix the driver logic for recent versions of DragonFly. 2013-04-11 22:55:55 +00:00
Edit [objcmt] Fix a mishandled conversion to objc directory literal. 2013-04-06 01:13:17 +00:00
Format Revamps structural error detection / handling. 2013-04-12 14:13:36 +00:00
Frontend <rdar://problem/13615607> Include SDK version information in the module hash. 2013-04-12 00:18:53 +00:00
FrontendTool <rdar://problem/13509689> Introduce -module-file-info option that provides information about a particular module file. 2013-03-27 16:47:18 +00:00
Headers tl;dr: Teach Clang to work around g++ changing its workaround to glibc's 2013-04-12 22:11:07 +00:00
Lex Improve the diagnostics of the number-reading preprocessor directives. 2013-04-10 01:04:18 +00:00
Parse <rdar://problem/13540921> Fix a crasher when an Objective-C for-in loop gets a non-variable iteration declaration. 2013-04-08 20:52:24 +00:00
Rewrite [frontend] -frewrite-includes: turn implicit module imports into @imports. 2013-04-10 01:53:50 +00:00
Sema Sema: Give a typically small DenseMap some inline capacity. 2013-04-12 15:22:25 +00:00
Serialization <rdar://problem/13643854> Only emit ambiguous-expansion warnings when at least one of the macro definitions comes from a non-system header. 2013-04-12 21:00:54 +00:00
StaticAnalyzer [analyzer] Makes NewDeleteLeaks checker work independently from NewDelete. 2013-04-12 20:48:49 +00:00
Tooling ClangTool output cleanup 2013-03-15 20:14:01 +00:00
CMakeLists.txt Initial version of formatting library. 2012-12-03 18:12:45 +00:00
Makefile Dont use/link ARCMT, StaticAnalyzer and Rewriter to clang when the user 2012-12-13 16:09:42 +00:00