]> granicus.if.org Git - clang/commit
[modules] When a #include is mapped to a module import and appears somewhere
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 17 Nov 2015 23:32:01 +0000 (23:32 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 17 Nov 2015 23:32:01 +0000 (23:32 +0000)
commit41a6e73085bd3a4ea29f06d20cb48d1776774cee
tree06cd705b9669f3e1d4020f5efea6f273ad0a0fe6
parent419abc999527f509a61a88ea0d2d2413313b3b95
[modules] When a #include is mapped to a module import and appears somewhere
other than the top level, we issue an error. This breaks a fair amount of C++
code wrapping C libraries, where the C library is #included within a namespace
/ extern "C" combination, because the C library (probably) includes C++
standard library headers which may be within modules.

Without modules, this setup is harmless if (and *only* if) the corresponding
standard library module was already included outside the namespace, so
downgrade the error to a default-error extension in that case, so that it can
be selectively disabled for such misbehaving libraries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253398 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Parse/ParseDecl.cpp
lib/Parse/ParseDeclCXX.cpp
lib/Parse/ParseStmt.cpp
lib/Sema/SemaDecl.cpp
test/Modules/auto-module-import.m