diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/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); diff --git a/clang/test/CodeCompletion/included-files.cpp b/clang/test/CodeCompletion/included-files.cpp --- a/clang/test/CodeCompletion/included-files.cpp +++ b/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 // 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"