It is ok to have c++-ness inside extern "C"
block. Fixes pr6644.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101948
91177308-0d34-0410-b5e6-
96231b3b80d8
static const DeclContext *IgnoreLinkageSpecDecls(const DeclContext *DC) {
while (isa<LinkageSpecDecl>(DC)) {
- assert(cast<LinkageSpecDecl>(DC)->getLanguage() ==
- LinkageSpecDecl::lang_cxx && "Unexpected linkage decl!");
DC = DC->getParent();
}
--- /dev/null
+// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+// pr6644
+
+extern "C" {
+ namespace N {
+ struct X {
+ virtual void f();
+ };
+ void X::f() { }
+ }
+}
+
+// CHECK: define void @_ZN1N1X1fEv