Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[skip-ci] clarify rationale of skipping leading 'class '
as suggested by pcanal
  • Loading branch information
ferdymercury authored Dec 4, 2024
commit 044b1a4e2c3fe94fa77c8d7c2f04ba54b58038e1
4 changes: 4 additions & 0 deletions core/foundation/src/TClassEdit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,9 @@
bool TClassEdit::IsDefAlloc(const char *allocname, const char *classname)
{
string_view a( allocname );
// In Windows, allocname might be 'class const std::allocator<int>',
// (never 'const class ...'), so we start by stripping the 'class ', if any
constexpr static int clalloclen = strlen("class ");

Check failure on line 626 in core/foundation/src/TClassEdit.cxx

View workflow job for this annotation

GitHub Actions / alma9-clang clang LLVM_ENABLE_ASSERTIONS=On, CMAKE_C_COMPILER=clang, CMAKE_CXX_COMPILER=clang++

constexpr variable 'clalloclen' must be initialized by a constant expression
if (a.compare(0,clalloclen,"class ") == 0) {
a.remove_prefix(clalloclen);
}
Expand All @@ -631,7 +633,7 @@
if (a=="__default_alloc_template<true,0>") return true;
if (a=="__malloc_alloc_template<0>") return true;

constexpr static int alloclen = strlen("allocator<");

Check failure on line 636 in core/foundation/src/TClassEdit.cxx

View workflow job for this annotation

GitHub Actions / alma9-clang clang LLVM_ENABLE_ASSERTIONS=On, CMAKE_C_COMPILER=clang, CMAKE_CXX_COMPILER=clang++

constexpr variable 'alloclen' must be initialized by a constant expression
if (a.compare(0,alloclen,"allocator<") != 0) {
return false;
}
Expand Down Expand Up @@ -680,7 +682,7 @@
string_view a( allocname );
RemoveStd(a);

constexpr static int alloclen = strlen("allocator<");

Check failure on line 685 in core/foundation/src/TClassEdit.cxx

View workflow job for this annotation

GitHub Actions / alma9-clang clang LLVM_ENABLE_ASSERTIONS=On, CMAKE_C_COMPILER=clang, CMAKE_CXX_COMPILER=clang++

constexpr variable 'alloclen' must be initialized by a constant expression
if (a.compare(0,alloclen,"allocator<") != 0) {
return false;
}
Expand All @@ -688,7 +690,7 @@

RemoveStd(a);

constexpr static int pairlen = strlen("pair<");

Check failure on line 693 in core/foundation/src/TClassEdit.cxx

View workflow job for this annotation

GitHub Actions / alma9-clang clang LLVM_ENABLE_ASSERTIONS=On, CMAKE_C_COMPILER=clang, CMAKE_CXX_COMPILER=clang++

constexpr variable 'pairlen' must be initialized by a constant expression
if (a.compare(0,pairlen,"pair<") != 0) {
return false;
}
Expand Down Expand Up @@ -1537,6 +1539,8 @@
}
while (tname[cursor]==' ') ++cursor;
}
// In Windows, we might have 'class const ...' as name,
// (never 'const class ...'), so skip the leading 'class ', if any
if (tname[cursor]=='c' && (cursor+6<len)) {
if (strncmp(tname+cursor,"class ",6) == 0) {
cursor += 6;
Expand Down
Loading