Reparsing templated types does not update type definitions in IDA Local Types

Affected IDA version:
Probably all of them starting from the very first version to include clang support and up to 9.2 beta 2.

Steps to reproduce.

  1. Compile the following C++ program (Windows, Linux, MacOS):
int main(){}
  1. Open and decompile generated executable in IDA (any other executable will also do).

  2. Under Options > Compiler choose:

  • “Source parser”: clang (new or old does not matter);
  • "Parser specific options” check “Apply tinfo to mangled names” (may not be relevant for this super simple example but important for real use-cases when mangled debug names are available in the executable).
  1. Do File > Load file > Parse C header file (Ctrl+F9) for the following header file:
struct SimpleStruct
{
	int a; // Change type/name here then reparse (see step 6 below).
	int b;
};

template<typename T>
struct TemplatedStruct
{
	int a; // Change type/name here then reparse (see step 6 below).
	T b;
};

using dummy = TemplatedStruct<int>; // This line forces IDA to create a Local Type for TemplatedStruct<int> in the IDA database.
  1. Inspect “Local Types” window and observe created definitions for SimpleStruct and TemplatedStruct<int>.

  2. Modify header file above, for ex. change int a; to char aaa; for both SimpleStruct and TemplatedStruct<int>.

  3. Parse Ctrl+F9 modified header file again.

  4. Inspect “Local Types” window and observe how the old definition for SimpleStruct is updated with char aaa; but the definition for TemplatedStruct<int> is not updated.

Expected behaviour:

Reparsing header file automatically updates definition of TemplatedStruct<int> in IDA Local Types analogous how it updated definition for SimpleStruct.

Hello,
Thanks for taking the time to describe your issue. Could you please open an official bug report for it? That way, it won’t get lost and we can track it properly. Thank you!

Submitted report using provided link: “Your reference is SUPPORT-5667”.

2 Likes