]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1455: C++ 20 modules are not recognized v9.0.1455
authorBen Jackson <puremourning@gmail.com>
Sat, 15 Apr 2023 17:17:17 +0000 (18:17 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 15 Apr 2023 17:17:17 +0000 (18:17 +0100)
Problem:    C++ 20 modules are not recognized.
Solution:   Add patterns to recognize C++ 20 modules as "cpp". (Ben Jackson,
            closes #12261)

runtime/filetype.vim
src/testdir/test_filetype.vim
src/version.c

index 56df5d6b4d45c966815273af68a87451e50e3d2b..b5262d1e9ed27aa25bad72726f71f724e7eaa0e5 100644 (file)
@@ -338,6 +338,10 @@ if has("fname_case")
   au BufNewFile,BufRead *.C,*.H setf cpp
 endif
 
+" C++ 20 modules (clang)
+" https://clang.llvm.org/docs/StandardCPlusPlusModules.html#file-name-requirement
+au BufNewFile,BufRead *.cppm,*.ccm,*.cxxm,*.c++m setf cpp
+
 " .h files can be C, Ch C++, ObjC or ObjC++.
 " Set c_syntax_for_h if you want C, ch_syntax_for_h if you want Ch. ObjC is
 " detected automatically.
index af2969dd8ca2264e7075eec0e0fb30cf5ff32dc0..0b8b52c88ec13fa76d622b57efde082a1eafff1a 100644 (file)
@@ -127,7 +127,7 @@ let s:filename_checks = {
     \ 'context': ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'],
     \ 'cook': ['file.cook'],
     \ 'cpon': ['file.cpon'],
-    \ 'cpp': ['file.cxx', 'file.c++', 'file.hh', 'file.hxx', 'file.hpp', 'file.ipp', 'file.moc', 'file.tcc', 'file.inl', 'file.tlh'],
+    \ 'cpp': ['file.cxx', 'file.c++', 'file.hh', 'file.hxx', 'file.hpp', 'file.ipp', 'file.moc', 'file.tcc', 'file.inl', 'file.tlh', 'file.cppm', 'file.ccm', 'file.cxxm', 'file.c++m'],
     \ 'cqlang': ['file.cql'],
     \ 'crm': ['file.crm'],
     \ 'crontab': ['crontab', 'crontab.file', '/etc/cron.d/file', 'any/etc/cron.d/file'],
index 9a50ab0fd17043097cb2104db99e2b1781630db0..50773f844421b7efc9f37c0dc7cce7a11ef051dd 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1455,
 /**/
     1454,
 /**/