Fixed generation of class_model_class diagram

This commit is contained in:
Bartek Kryza
2023-02-18 23:04:32 +01:00
parent c2b83e2396
commit bdf9a7e18f
2 changed files with 10 additions and 4 deletions

View File

@@ -25,7 +25,8 @@ endif(MSVC)
target_compile_features(clang-umllib INTERFACE cxx_std_17)
target_compile_options(clang-umllib PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:
-Werror -Wall -Wextra -Wno-unused-parameter -Wno-unused-private-field>
-Werror -Wall -Wextra -Wno-unused-parameter -Wno-unused-private-field
-Wno-deprecated-declarations>
$<$<CXX_COMPILER_ID:MSVC>:/MP /W1 /bigobj /wd4291 /wd4624 /wd4244>)
target_compile_definitions(clang-umllib PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:
@@ -39,7 +40,8 @@ add_executable(clang-uml ${MAIN_SOURCE_FILE})
target_compile_features(clang-uml PUBLIC cxx_std_17)
target_compile_options(clang-uml PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:
-Werror -Wall -Wextra -Wno-unused-parameter -Wno-unused-private-field>
-Werror -Wall -Wextra -Wno-unused-parameter -Wno-unused-private-field
-Wno-deprecated-declarations>
$<$<CXX_COMPILER_ID:MSVC>:/MP /W1 /bigobj /wd4291 /wd4624 /wd4244>)
target_link_libraries(clang-uml
${YAML_CPP_LIBRARIES}

View File

@@ -897,8 +897,12 @@ void translation_unit_visitor::
desugared_atsp = deduced_type->getDeducedType();
}
const auto *deduced_record_type =
desugared_atsp->getAs<clang::RecordType>();
if (desugared_atsp.isNull())
return;
const auto *deduced_record_type = desugared_atsp->isRecordType()
? desugared_atsp->getAs<clang::RecordType>()
: nullptr;
if (deduced_record_type != nullptr) {
if (auto *deduced_auto_decl =