Skip to content

Fixed crashes on unresolved template declarations - #457

Merged
bkryza merged 3 commits into
bkryza:masterfrom
artemrizhov:fix/unresolved-template-declarations
Aug 19, 2026
Merged

Fixed crashes on unresolved template declarations#457
bkryza merged 3 commits into
bkryza:masterfrom
artemrizhov:fix/unresolved-template-declarations

Conversation

@artemrizhov

Copy link
Copy Markdown
Contributor

Summary

Prevent null dereferences while processing template specializations whose
TemplateName cannot be resolved to a TemplateDecl.

This affects both class and sequence diagram visitors when handling
template-template parameters such as C<T>.

The change:

  • returns without adding an unresolved class relationship;
  • skips unresolved class-template method calls in sequence diagrams;
  • reuses the validated template declaration instead of resolving it again.

Regression test

Adds t00102, covering both visitors with a template-template parameter:

  • a class method parameter of type C<T>;
  • a call to C<T>::call().

Before this change, these cases can dereference the null result of
getAsTemplateDecl() and crash.

@bkryza

bkryza commented Aug 13, 2026

Copy link
Copy Markdown
Owner

@artemrizhov Thanks for the PR - could you also add an entry in the test_cases.yaml - just after the entry for t00101 - https://github.com/bkryza/clang-uml/blob/master/tests/test_cases.yaml#L302, just put some title and description can be empty...

@artemrizhov
artemrizhov force-pushed the fix/unresolved-template-declarations branch from 33d646f to 1bdf534 Compare August 19, 2026 11:19
@artemrizhov

Copy link
Copy Markdown
Contributor Author

Done

@bkryza
bkryza merged commit 3cca093 into bkryza:master Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants