Skip to content
Commit dbd93bfc authored by Douglas Gregor's avatar Douglas Gregor
Browse files

Always allow redefinition of typedefs when modules are enabled. This

is important because it's fairly common for headers (especially system
headers) to want to provide only those typedefs needed for that
particular header, based on some guard macro, e.g.,

#ifndef _SIZE_T
#define _SIZE_T
typedef long size_t;
#endif

which is repeated in a number of headers. The guard macro protects
against duplicate definitions. However, this means that only the first
occurrence of this pattern actually defines size_t, so the submodule
corresponding to this header has the only visible definition. If a
user then imports a different submodule from the same module, size_t
will be known but not visible, and therefore cannot be used.

By allowing redefinition of typedefs, each header that wants to define
size_t can do so independently, so it will be available in the
corresponding submodules.

llvm-svn: 147775
parent 3732fa54
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment