[PATCH] D52253: Fix an assert in the implementation of -Wquoted-include-in-framework-header

Phabricator via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 20 12:05:19 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL342679: Fix an assert in -Wquoted-include-in-framework-header (authored by epilk, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D52253?vs=166070&id=166344#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D52253

Files:
  cfe/trunk/lib/Lex/HeaderSearch.cpp
  cfe/trunk/test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing1.h
  cfe/trunk/test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing2.h
  cfe/trunk/test/Modules/double-quotes.m


Index: cfe/trunk/lib/Lex/HeaderSearch.cpp
===================================================================
--- cfe/trunk/lib/Lex/HeaderSearch.cpp
+++ cfe/trunk/lib/Lex/HeaderSearch.cpp
@@ -648,7 +648,7 @@
     ++I;
   }
 
-  return FoundComp >= 2;
+  return !FrameworkName.empty() && FoundComp >= 2;
 }
 
 static void
Index: cfe/trunk/test/Modules/double-quotes.m
===================================================================
--- cfe/trunk/test/Modules/double-quotes.m
+++ cfe/trunk/test/Modules/double-quotes.m
@@ -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 at Inputs/double-quotes/A.framework/Headers/A.h:1{{double-quoted include "A0.h" in framework header, expected angle-bracketed instead}}
Index: cfe/trunk/test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing2.h
===================================================================
--- cfe/trunk/test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing2.h
+++ cfe/trunk/test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing2.h
@@ -0,0 +1 @@
+// Empty file!
Index: cfe/trunk/test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing1.h
===================================================================
--- cfe/trunk/test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing1.h
+++ cfe/trunk/test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing1.h
@@ -0,0 +1 @@
+#include "Thing2.h"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52253.166344.patch
Type: text/x-patch
Size: 1617 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180920/f6c79258/attachment.bin>


More information about the cfe-commits mailing list