Skip to content

Commit 2d76de1

Browse files
tautschnigDaniel Kroening
authored and
Daniel Kroening
committed
Synchronise file extensions between C++ language and C/C++ preprocessor
Largely follows GCC's documentation at https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html#index-file-name-suffix-71, with the extension that we accept some uppercase variants in C/C++ pre-processing. Fixes: #4358
1 parent 029d820 commit 2d76de1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/ansi-c/c_preprocess.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,8 @@ bool c_preprocess_gcc_clang(
585585
has_suffix(file, ".C") ||
586586
#endif
587587
has_suffix(file, ".c++") || has_suffix(file, ".C++") ||
588-
has_suffix(file, ".cp") || has_suffix(file, ".CP"))
588+
has_suffix(file, ".cp") || has_suffix(file, ".CP") ||
589+
has_suffix(file, ".cc") || has_suffix(file, ".cxx"))
589590
{
590591
switch(config.cpp.cpp_standard)
591592
{

src/cpp/cpp_language.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ std::set<std::string> cpp_languaget::extensions() const
3737
s.insert("cpp");
3838
s.insert("CPP");
3939
s.insert("cc");
40+
s.insert("cp");
4041
s.insert("c++");
4142
s.insert("ii");
4243
s.insert("cxx");

0 commit comments

Comments
 (0)