summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclCXX.cpp
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2017-09-26 18:55:16 +0000
committerErich Keane <erich.keane@intel.com>2017-09-26 18:55:16 +0000
commit99eda60b49e6c483f8548eb69709d8b5a7bed7b8 (patch)
tree538fc3a2bcfcb70c7ed4c23eaf1a7da18af23461 /clang/lib/AST/DeclCXX.cpp
parent645f777e40c367e5a73acfc400677250a4661b32 (diff)
downloadbcm5719-llvm-99eda60b49e6c483f8548eb69709d8b5a7bed7b8.tar.gz
bcm5719-llvm-99eda60b49e6c483f8548eb69709d8b5a7bed7b8.zip
Allow IUnknown/IInterface types to come from extern C++
It was brought up in response to my last implementation for this struct-as-interface features that at least 1 header in the MS SDK uses "extern C++" around an IUnknown declaration. The previous implementation demanded that this type exist in the TranslationUnit DeclContext. This small change simply also allows in the situation where we're extern "C++". llvm-svn: 314235
Diffstat (limited to 'clang/lib/AST/DeclCXX.cpp')
-rw-r--r--clang/lib/AST/DeclCXX.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp
index d63d42c66ff..e85ab418514 100644
--- a/clang/lib/AST/DeclCXX.cpp
+++ b/clang/lib/AST/DeclCXX.cpp
@@ -1491,7 +1491,8 @@ bool CXXRecordDecl::isInterfaceLike() const {
// Check "Special" types.
const auto *Uuid = getAttr<UuidAttr>();
- if (Uuid && isStruct() && getDeclContext()->isTranslationUnit() &&
+ if (Uuid && isStruct() && (getDeclContext()->isTranslationUnit() ||
+ getDeclContext()->isExternCXXContext()) &&
((getName() == "IUnknown" &&
Uuid->getGuid() == "00000000-0000-0000-C000-000000000046") ||
(getName() == "IDispatch" &&
OpenPOWER on IntegriCloud