Created attachment 10258 [details] test source Given: [ben@localhost c++test]$ cat test1.cpp template <typename T, typename U = T*> struct A; A<int> *p; [ben@localhost c++test]$ c++ -c -g test1.cpp [ben@localhost c++test]$ clang++ -c -g test1.cpp -o test1-clang.o [ben@localhost c++test]$ ../libabigail/build/tools/abidiff test1.o test1-clang.o Functions changes summary: 0 Removed, 0 Changed, 0 Added function Variables changes summary: 0 Removed, 1 Changed, 0 Added variable 1 Changed variable: [C]'A<int, int*>* p' was changed to 'A<int, int *>* p' at test1.cpp:3:1: type of variable changed: in pointed to type 'struct A<int, int*>': type name changed from 'A<int, int*>' to 'A<int, int *>' type size hasn't changed These should evaluate the same because the only difference is in the whitespace. Furthermore this is not an actual ABI artifact as can be seen by: [ben@localhost c++test]$ cat test2.cpp template <typename T, typename U = T*> struct A { T a; U b; }; A<int> i; [ben@localhost c++test]$ c++ -c -g test2.cpp [ben@localhost c++test]$ clang++ -c -g test2.cpp -o test2-clang.o [ben@localhost c++test]$ ../libabigail/build/tools/abidiff test2.o test2-clang.o Functions changes summary: 0 Removed, 0 Changed, 0 Added function Variables changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added variable
Created attachment 10259 [details] test2
Created attachment 10260 [details] gcc object
Created attachment 10261 [details] clang object
Created attachment 10262 [details] test2 gcc object
Created attachment 10263 [details] test2 clang object
I think the general problem is more involved than just ignoring white spaces in type names. That problem has already been expressed at https://sourceware.org/bugzilla/show_bug.cgi?id=21296#c2. I am closing this bug as a duplicate of that previous bug. This bug report is interesting though, because it adds reproducers that can be used to test the solution that will be proposed for the issue, eventually. Thanks! *** This bug has been marked as a duplicate of bug 21296 ***
Evidently the real problem here is actually the inverse of what I reported. The problem is actually that test2 is not reporting the fact that there is a difference in the name and filtering out the change. While test1 continues to be a duplicate of 21296.
Dodji, I know that we discussed this in chat and you pointed out that it was test2 that was wrong rather than test1 and that it was considering something harmless which wasn't but I can't recall what that was. Can you explain it again? [ben@localhost c++test]$ abidiff --no-unreferenced-symbols --harmless test2.o test2-clang.o Functions changes summary: 0 Removed, 0 Changed, 0 Added function Variables changes summary: 0 Removed, 1 Changed, 0 Added variable 1 Changed variable: [C]'A<int, int*> i' was changed to 'A<int, int *> i' at test2.cpp:6:1: type of variable changed: type name changed from 'A<int, int*>' to 'A<int, int *>' type size hasn't changed 2 data member changes: name of 'A<int, int*>::a' changed to 'A<int, int *>::a' at test2.cpp:2:1 name of 'A<int, int*>::b' changed to 'A<int, int *>::b' at test2.cpp:3:1 [ben@localhost c++test]$ cat test2. test2.cpp test2.o [ben@localhost c++test]$ cat test2.cpp template <typename T, typename U = T*> struct A { T a; U b; }; A<int> i; I recognize that 21296 is the issue regarding normalizing types which appears in the typenames but I don't see in this case why considering this change harmless is a problem. I think you said that it was because it was considered harmless for the wrong reason but I don't recall what you said was the reason.
This problem continues to exist as of commit: 2cc1ab7ee879da20688c4a72ec93c73123d7b9aa