Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'newline in constant' encoding issue in clangd sources #78082

Closed
wants to merge 2 commits into from
Closed

Fix 'newline in constant' encoding issue in clangd sources #78082

wants to merge 2 commits into from

Conversation

cppcloud
Copy link

Files within clang-tools-extra/clangd encountered 'newline in constant' errors while compiling with Visual Studio Community 2022 Preview (amd64). The affected files were CodeComplete.h, Diagnostics.cpp, and Selection.cpp.

This issue stems from the MSVC compiler mishandling UTF-8 encoded files without a Byte Order Mark (BOM). To address this, the encoding of these three files has been changed from UTF-8 to UTF-8 with BOM.

Affected files:

  • clang-tools-extra/clangd/CodeComplete.h
  • clang-tools-extra/clangd/Diagnostics.cpp
  • clang-tools-extra/clangd/Selection.cpp

The fix has been verified to resolve the build issues without introducing further problems in other parts of the LLVM project.

Files within clang-tools-extra/clangd encountered 'newline in constant'
errors while compiling with Visual Studio Community 2022 Preview (amd64).
The affected files were CodeComplete.h, Diagnostics.cpp, and Selection.cpp.

This issue stems from the MSVC compiler mishandling UTF-8 encoded files
without a Byte Order Mark (BOM). To address this, the encoding of these
three files has been changed from UTF-8 to UTF-8 with BOM.

Affected files:
- clang-tools-extra/clangd/CodeComplete.h
- clang-tools-extra/clangd/Diagnostics.cpp
- clang-tools-extra/clangd/Selection.cpp

The fix has been verified to resolve the build issues without introducing
further problems in other parts of the LLVM project.
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot llvmbot added the clangd label Jan 14, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 14, 2024

@llvm/pr-subscribers-clangd

Author: BinVerse (BinVerse)

Changes

Files within clang-tools-extra/clangd encountered 'newline in constant' errors while compiling with Visual Studio Community 2022 Preview (amd64). The affected files were CodeComplete.h, Diagnostics.cpp, and Selection.cpp.

This issue stems from the MSVC compiler mishandling UTF-8 encoded files without a Byte Order Mark (BOM). To address this, the encoding of these three files has been changed from UTF-8 to UTF-8 with BOM.

Affected files:

  • clang-tools-extra/clangd/CodeComplete.h
  • clang-tools-extra/clangd/Diagnostics.cpp
  • clang-tools-extra/clangd/Selection.cpp

The fix has been verified to resolve the build issues without introducing further problems in other parts of the LLVM project.


Full diff: https://github.com/llvm/llvm-project/pull/78082.diff

3 Files Affected:

  • (modified) clang-tools-extra/clangd/CodeComplete.h (+1-1)
  • (modified) clang-tools-extra/clangd/Diagnostics.cpp (+1-1)
  • (modified) clang-tools-extra/clangd/Selection.cpp (+1-1)
diff --git a/clang-tools-extra/clangd/CodeComplete.h b/clang-tools-extra/clangd/CodeComplete.h
index a7c1ae95dcbf49..571defc7cf1b8e 100644
--- a/clang-tools-extra/clangd/CodeComplete.h
+++ b/clang-tools-extra/clangd/CodeComplete.h
@@ -1,4 +1,4 @@
-//===--- CodeComplete.h ------------------------------------------*- C++-*-===//
+//===--- CodeComplete.h ------------------------------------------*- C++-*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/clang-tools-extra/clangd/Diagnostics.cpp b/clang-tools-extra/clangd/Diagnostics.cpp
index 704e61b1e4dd79..68ed94262a6bff 100644
--- a/clang-tools-extra/clangd/Diagnostics.cpp
+++ b/clang-tools-extra/clangd/Diagnostics.cpp
@@ -1,4 +1,4 @@
-//===--- Diagnostics.cpp -----------------------------------------*- C++-*-===//
+//===--- Diagnostics.cpp -----------------------------------------*- C++-*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/clang-tools-extra/clangd/Selection.cpp b/clang-tools-extra/clangd/Selection.cpp
index 277cb8769a1b12..1514cf49532504 100644
--- a/clang-tools-extra/clangd/Selection.cpp
+++ b/clang-tools-extra/clangd/Selection.cpp
@@ -1,4 +1,4 @@
-//===--- Selection.cpp ----------------------------------------------------===//
+//===--- Selection.cpp ----------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.

@cppcloud cppcloud closed this Jan 14, 2024
@cppcloud cppcloud deleted the bugfix/clang-tools-extra branch January 14, 2024 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants