-
-
This project is a minimal/complete template that includes an
LLVM/Clang-basedC++compilation environment,VSCodedevelopment setup, and example code utilizing the latestC++20~26features. -
It is designed to work with the same structure on both
WindowsandLinux.
- This project includes:
CMake-based build system- Enforced
clang/clang++usage configuration C++26compilation enabledLLDlinker usage (-fuse-ld=lld)VSCodedevelopment environment setup (IntelliSense,clangd,LLDB DAP)- Example code (
main.cpp) usingC++20/23/26features
- Prioritizes the
LLVM_HOMEenvironment variable- Automatically uses
C:/llvm-packageonWindows
- Automatically uses
- Forces
clang,clang++asCMAKE_C_COMPILER/CMAKE_CXX_COMPILER - Uses
LLDlinker (-fuse-ld=lld) - Enables
C++26compilation (target_compile_features(... cxx_std_26)) - Automatically generates
compile_commands.json
➡ This is an ideal basic structure for VSCode + clangd users.
C++20ranges/views/std::formatC++23std::expectedC++26deducing thissyntax applied (Point::move)- Includes advanced examples (filtering, transformation,
join view, structured message generation, etc.)
- This single file allows you to verify actual execution examples of
C++20~26features.
- Sets
IntelliSenseengine toclang-based - Automatically references
compile_commands.json - Basic
includePathconfiguration
- Automatically recommends the following extensions:
ms-vscode.cmake-toolsms-vscode.cpptoolsllvm-vs-code-extensions.vscode-clangd
LLDB-DAP-based debugging configuration- Automatic executable branching by
OS(Windowsuseshello.exe)
CMake generator = Ninja- Sets
clang++as the defaultIntelliSensecompiler editor.formatOnSaveoption
CMake ConfigureCMake BuildVSCodebuild automation configuration
cmake -S . -B build -G Ninja
cmake --build build --config Debug./build/hello.\build\hello.exe-
(1) Install Extensions
ms-vscode.cmake-toolsllvm-vs-code-extensions.vscode-clangdllvm-vs-code-extensions.lldb-dap
-
(2) VSCode left sidebar Run/Debug menu → Run Debug (lldb-dap)
- Actual executable examples of C++20 / C++23 / C++26 key new features
- Includes all of
ranges,views,format,expected - Uses operator chaining style with "
deducing this" syntax - Assembles example messages into strings for output in
main
project_root/
│ CMakeLists.txt
│ main.cpp
│
├─ .vscode/
│ ├─ c_cpp_properties.json
│ ├─ extensions.json
│ ├─ launch.json
│ ├─ settings.json
│ └─ tasks.json
│
└─ build/ (generated by cmake)
LLVM/Clangdevelopment environment testing- Experimenting with latest
C++standards (C++20~C++26) - Basic structure for
C++projects based onVSCode+clangd+LLDB CMake-based multi-platform template
- MIT