ckandeler created this revision. ckandeler added a reviewer: sammccall. ckandeler requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Real-world use case: The Qt framework's headers have the same name as the respective class defined in them, and Qt's traditional qmake build tool uses -I (rather than -isystem) to pull them in. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D112996 Files: clang/lib/Sema/SemaCodeComplete.cpp clang/test/CodeCompletion/included-files.cpp Index: clang/test/CodeCompletion/included-files.cpp =================================================================== --- clang/test/CodeCompletion/included-files.cpp +++ clang/test/CodeCompletion/included-files.cpp @@ -22,12 +22,12 @@ // CHECK-3-NOT: foo.h> // CHECK-3: foosys> -// With -I rather than -isystem, the header extension is required. +// A header extension is not required. #include <foosys> // RUN: %clang -fsyntax-only -I %t/a -Xclang -code-completion-at=%t/main.cc:26:13 %t/main.cc | FileCheck -check-prefix=CHECK-4 %s // CHECK-4-NOT: foo.cc> // CHECK-4-NOT: foo.h> -// CHECK-4-NOT: foosys> +// CHECK-4: foosys> // Backslash handling. #include "a\foosys" Index: clang/lib/Sema/SemaCodeComplete.cpp =================================================================== --- clang/lib/Sema/SemaCodeComplete.cpp +++ clang/lib/Sema/SemaCodeComplete.cpp @@ -9648,7 +9648,8 @@ if (!(Filename.endswith_insensitive(".h") || Filename.endswith_insensitive(".hh") || Filename.endswith_insensitive(".hpp") || - Filename.endswith_insensitive(".inc"))) + Filename.endswith_insensitive(".inc") || + !Filename.contains('.'))) break; } AddCompletion(Filename, /*IsDirectory=*/false);
Index: clang/test/CodeCompletion/included-files.cpp =================================================================== --- clang/test/CodeCompletion/included-files.cpp +++ clang/test/CodeCompletion/included-files.cpp @@ -22,12 +22,12 @@ // CHECK-3-NOT: foo.h> // CHECK-3: foosys> -// With -I rather than -isystem, the header extension is required. +// A header extension is not required. #include <foosys> // RUN: %clang -fsyntax-only -I %t/a -Xclang -code-completion-at=%t/main.cc:26:13 %t/main.cc | FileCheck -check-prefix=CHECK-4 %s // CHECK-4-NOT: foo.cc> // CHECK-4-NOT: foo.h> -// CHECK-4-NOT: foosys> +// CHECK-4: foosys> // Backslash handling. #include "a\foosys" Index: clang/lib/Sema/SemaCodeComplete.cpp =================================================================== --- clang/lib/Sema/SemaCodeComplete.cpp +++ clang/lib/Sema/SemaCodeComplete.cpp @@ -9648,7 +9648,8 @@ if (!(Filename.endswith_insensitive(".h") || Filename.endswith_insensitive(".hh") || Filename.endswith_insensitive(".hpp") || - Filename.endswith_insensitive(".inc"))) + Filename.endswith_insensitive(".inc") || + !Filename.contains('.'))) break; } AddCompletion(Filename, /*IsDirectory=*/false);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits