From: Bruno Turcksin Date: Thu, 6 Feb 2025 16:17:15 +0000 (+0000) Subject: Make clear than this refers to the object pointer X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F18095%2Fhead;p=dealii.git Make clear than this refers to the object pointer --- diff --git a/include/deal.II/grid/reference_cell.h b/include/deal.II/grid/reference_cell.h index 4b0a7a357b..8d29514a52 100644 --- a/include/deal.II/grid/reference_cell.h +++ b/include/deal.II/grid/reference_cell.h @@ -3540,9 +3540,9 @@ ReferenceCell::get_combined_orientation( return o; } - // Do not use this in Assert because nvcc when using C++20 assumes that this - // is an integer and we get the following error: invalid type argument of - // unary '*' (have 'int') + // Do not use `this` in Assert because nvcc when using C++20 assumes that + // `this` is an integer and we get the following error: invalid type + // argument of unary '*' (have 'int') [[maybe_unused]] const auto &ref_cell = *this; Assert(false, (internal::NoPermutation(ref_cell, vertices_0, vertices_1))); diff --git a/source/fe/fe_system.cc b/source/fe/fe_system.cc index 04d982d245..67aeb6365a 100644 --- a/source/fe/fe_system.cc +++ b/source/fe/fe_system.cc @@ -1799,8 +1799,9 @@ FESystem::initialize( { const unsigned int base = this->system_to_base_table[i].first.first, base_index = this->system_to_base_table[i].second; - // Do not use this in Assert because nvcc when using C++20 assumes that - // this is an integer and we get the following error: base operand of + // Do not use `this` in Assert because nvcc when using C++20 assumes + // that `this` is an integer and we get the following error: base + // operand of // '->' is not a pointer [[maybe_unused]] const unsigned int n_base_elements = this->n_base_elements(); @@ -1962,10 +1963,9 @@ FESystem::initialize( { // the array into which we want to write should have the correct size // already. - // Do not use this in Assert because nvcc when using C++20 assumes - // that this is an integer and we get the following error: base - // operand of - // '->' is not a pointer + // Do not use `this` in Assert because nvcc when using C++20 assumes + // that `this` is an integer and we get the following error: base + // operand of '->' is not a pointer [[maybe_unused]] const unsigned int n_elements = this->adjust_quad_dof_index_for_face_orientation_table[face_no] .n_elements(); @@ -1996,13 +1996,12 @@ FESystem::initialize( index += temp.size(0); } } - // error: base operand of '->' is not a pointer Assert(index == n_dofs_per_quad, ExcInternalError()); } // additionally compose the permutation information for lines - // Do not use this in Assert because nvcc when using C++20 assumes that - // this is an integer and we get the following error: base operand of + // Do not use `this` in Assert because nvcc when using C++20 assumes that + // `this` is an integer and we get the following error: base operand of // '->' is not a pointer [[maybe_unused]] const unsigned int table_size = this->adjust_line_dof_index_for_line_orientation_table.size(); diff --git a/source/fe/mapping_q_cache.cc b/source/fe/mapping_q_cache.cc index b6ed5e1271..1682bb7696 100644 --- a/source/fe/mapping_q_cache.cc +++ b/source/fe/mapping_q_cache.cc @@ -159,8 +159,8 @@ MappingQCache::initialize( void *) { (*support_point_cache)[cell->level()][cell->index()] = compute_points_on_cell(cell); - // Do not use this in Assert because nvcc when using C++20 assumes that - // this is an integer and we get the following error: invalid type + // Do not use `this` in Assert because nvcc when using C++20 assumes that + // `this` is an integer and we get the following error: invalid type // argument of unary '*' (have 'int') [[maybe_unused]] const unsigned int d = this->get_degree() + 1; AssertDimension(