summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/AST/DeclCXX.cpp3
-rw-r--r--clang/test/SemaCXX/ms-iunknown.cpp2
2 files changed, 3 insertions, 2 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" &&
diff --git a/clang/test/SemaCXX/ms-iunknown.cpp b/clang/test/SemaCXX/ms-iunknown.cpp
index c965a4c0a1b..f73864d43fb 100644
--- a/clang/test/SemaCXX/ms-iunknown.cpp
+++ b/clang/test/SemaCXX/ms-iunknown.cpp
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s
-struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) IUnknown {
+extern "C++" struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) IUnknown {
void foo();
};
struct IPropertyPageBase : public IUnknown {};
OpenPOWER on IntegriCloud