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 @@ -2426,6 +2426,8 @@ ClangImporter::Implementation::DiagnosticWalker::DiagnosticWalker(
2426
2426
2427
2427
bool ClangImporter::Implementation::DiagnosticWalker::TraverseDecl (
2428
2428
clang::Decl *D) {
2429
+ if (!D)
2430
+ return true ;
2429
2431
// In some cases, diagnostic notes about types (ex: built-in types) do not
2430
2432
// have an obvious source location at which to display diagnostics. We
2431
2433
// 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