[PATCH] modularize - Add checks for #include in 'extern "C/C++" {}' or 'namespace (name) {}' blocks

John Thompson john.thompson.jtsoftware at gmail.com
Wed Sep 11 13:27:59 PDT 2013


Hi doug.gregor, silvas,

It's a potential problem for modules (and headers in general) if '#include' directives occur inside 'extern "C/C++" {}' or 'namespace (name) {}' blocks, because that can produce different underlying definitions if other sources include the header outside of such blocks.  This patch to modularize checks for these cases, treating them as errors, and produces error message referencing both the offending '#include' and the enclosing 'extern "C/C++" {}' or 'namespace (name) {}' block.


http://llvm-reviews.chandlerc.com/D1648

Files:
  test/modularize/Inputs/Empty.h
  test/modularize/Inputs/IncludeInExtern.h
  test/modularize/Inputs/IncludeInNamespace.h
  test/modularize/ProblemsExternC.modularize
  test/modularize/ProblemsNamespace.modularize
  modularize/PreprocessorTracker.cpp
  modularize/PreprocessorTracker.h
  modularize/Modularize.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1648.1.patch
Type: text/x-patch
Size: 19837 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130911/cc8fc96e/attachment.bin>


More information about the cfe-commits mailing list