[Bug c++/17310] __builtin_offsetof doesn't check dependent expressions

paolo.carlini at oracle dot com gcc-bugzilla@gcc.gnu.org
Fri Nov 4 23:55:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17310

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|gcc-bugs at gcc dot gnu.org |
      Known to work|                            |4.6.2, 4.7.0
         Resolution|                            |FIXED
      Known to fail|                            |

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-11-04 23:54:33 UTC ---
The testcase (modulo trivial typos):

struct S { int i; };

template <unsigned int I> struct A;
template <> struct A<0> { typedef int T; };

template <typename T>
void f() {
  typename A<__builtin_offsetof (S, i)>::T x;
}

is accepted in the currently active branches.



More information about the Gcc-bugs mailing list