https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98797

--- Comment #1 from Brian Sobulefsky <brian.sobulefsky at protonmail dot com> 
---
I have updated the repository I linked previously so that it has current gcc
sources and also includes a solution for the case where struct s2 is not a
single field, that is, we have something like:

struct s1
{
  char a;
  char b;
  char c;
  char d;
};

struct s2
{
  char arr1[2];
  char arr1[2];
};

struct s2 x = {{'A', 'B'}, {'C', 'D'}};
struct s1 *p = (struct s1 *)&x;

__analyzer_eval (p->a == 'A');

The solution I submitted basically has the logic right, but I put everything
into binding_cluster:get_binding_recursive instead of creating a new method for
class binding_cluster, which is the right way to do it. I did this just to have
a quick outline of the solution without altering the class members, but in my
view get_binding_recursive is too cluttered this way and the code in the case I
added should be moved to a new function.

Reply via email to