diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-17 22:04:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-17 22:04:20 +0000 |
commit | 2581fc3fa98e369cce35684a576ec59cb7cabe83 (patch) | |
tree | ffd875e37175b652de0af7f018198b184f94c533 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | ba6e55737825046a5e1dff82d54a0745f11c0796 (diff) | |
download | bcm5719-llvm-2581fc3fa98e369cce35684a576ec59cb7cabe83.tar.gz bcm5719-llvm-2581fc3fa98e369cce35684a576ec59cb7cabe83.zip |
tweak redefinition of a typedef a bit to fix a couple of problems:
1. We had logic in sema to decide whether or not to emit the error
based on manually checking whether in a system header file.
2. we were allowing redefinitions of typedefs in class scope in C++
if in header file.
3. there was no way to force typedef redefinitions to be accepted
by the C compiler, which annoys me when stripping linemarkers out
of .i files.
The fix is to split the C++ class typedef redefinition path from the
C path, and change the C path to be a warning that normally maps to
error. This causes it to properly be ignored in system headers,
etc. and gives us a way to control it. Passing
-Wtypedef-redefinition now turns the error into a warning.
One behavior change is that we now diagnose cases where you redefine
a typedef in your .c file that was defined in a header file. This
seems like reasonable behavior, and the diagnostic now indicates that
it can be controlled with -Wtypedef-redefinition.
llvm-svn: 69391
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions