Basic code analysis not working correctly in class template

Hello. I've been using CLion for a last few days for the first time and noticed that code analysis somehow breaks in template classes.
In normal classes or functions I haven't seen these problems.

Code below is an example to show the issues:

  • reassignment of const variable not being marked as error
  • returning a wrong type not being marked as error
  • accessing inexistent field not being marked as error

Here is example of these bugs not appearing in a different context:

This is in a CMake based project, and when there are no errors everything compiles and runs fine. I've also tested it with 2 different toolchains: Visual Studio and MinGW, and the bugs are present regardless of which one I use.

As for the basic technical details of my system and IDE:

CLion 2021.1
Build #CL-211.6693.114, built on April 6, 2021
Licensed to .....
Subscription is active until February 11, 2022.
For educational use only.
Runtime version: 11.0.10+9-b1341.35 amd64
VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2000M
Cores: 12
Registry: run.processes.with.pty=TRUE

Please sign in to leave a comment.