Fix an assert in -Wquoted-include-in-framework-header

Fixes rdar://43692300

Differential revision: https://reviews.llvm.org/D52253

llvm-svn: 342679
This commit is contained in:
Erik Pilkington 2018-09-20 19:00:03 +00:00
parent 386ad01c7b
commit abacc253a7
4 changed files with 6 additions and 1 deletions

View File

@ -648,7 +648,7 @@ static bool isFrameworkStylePath(StringRef Path, bool &IsPrivateHeader,
++I;
}
return FoundComp >= 2;
return !FrameworkName.empty() && FoundComp >= 2;
}
static void

View File

@ -0,0 +1 @@
#include "Thing2.h"

View File

@ -0,0 +1 @@
// Empty file!

View File

@ -32,6 +32,9 @@
#import "A.h"
#import <Z/Z.h>
// Make sure we correctly handle paths that resemble frameworks, but aren't.
#import "NotAFramework/Headers/Headers/Thing1.h"
int bar() { return foo(); }
// expected-warning@Inputs/double-quotes/A.framework/Headers/A.h:1{{double-quoted include "A0.h" in framework header, expected angle-bracketed instead}}