Files
swift-mirror/test/Interop/Cxx/class/friend-diag.swift
Akira Hatanaka 14cfebc640 Fix a crash in ClangImporter::Implementation::DiagnosticWalker::TraverseDecl
The call to `D->getBeginLoc` crashes when `D` is null.

rdar://118899818
2023-12-19 15:58:42 -08:00

30 lines
527 B
Swift

// RUN: rm -rf %t
// RUN: split-file %s %t
// RUN: %target-swiftxx-frontend -typecheck -I %t/Inputs %t/test.swift -verify
//--- Inputs/module.modulemap
module FriendClass {
header "test.h"
requires cplusplus
export *
}
//--- Inputs/test.h
template <class T>
class B {
~B() = delete;
};
class D : public B<D> { // expected-note {{record 'D' is not automatically available}}
friend class B<D>;
};
//--- test.swift
import FriendClass
func test() {
var v: D // expected-error {{cannot find type 'D' in scope}}
}