File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -2458,6 +2458,8 @@ ClangImporter::Implementation::DiagnosticWalker::DiagnosticWalker(
2458
2458
2459
2459
bool ClangImporter::Implementation::DiagnosticWalker::TraverseDecl (
2460
2460
clang::Decl *D) {
2461
+ if (!D)
2462
+ return true ;
2461
2463
// In some cases, diagnostic notes about types (ex: built-in types) do not
2462
2464
// have an obvious source location at which to display diagnostics. We
2463
2465
// provide the location of the closest decl as a reasonable choice.
Original file line number Diff line number Diff line change
1
+ // RUN: rm -rf %t
2
+ // RUN: split-file %s %t
3
+ // RUN: %target-swiftxx-frontend -typecheck -I %t/Inputs %t/test.swift -verify
4
+
5
+ //--- Inputs/module.modulemap
6
+ module FriendClass {
7
+ header " test.h "
8
+ requires cplusplus
9
+ export *
10
+ }
11
+
12
+ //--- Inputs/test.h
13
+
14
+ template < class T>
15
+ class B {
16
+ ~ B( ) = delete;
17
+ } ;
18
+
19
+ class D : public B< D > { // expected-note {{record 'D' is not automatically available}}
20
+ friend class B< D> ;
21
+ } ;
22
+
23
+ //--- test.swift
24
+
25
+ import FriendClass
26
+
27
+ func test( ) {
28
+ var v : D // expected-error {{cannot find type 'D' in scope}}
29
+ }
You can’t perform that action at this time.
0 commit comments