This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH: PR 23896



On Sep 15, 2005, at 9:52 PM, Mark Mitchell wrote:



This patch fixes yet another problem with static data members in templates. When substituting into "sizeof (S<I>::x)" we need to remember to evaluate "I", even though we don't need to evaluate "S<I>::x".

Just to double check, does this also fix the __alignof__ case too? Testcase: template <int> struct X {};

 template <typename T> struct length {
   static const int value = 2;
 };

 template <typename T> void foo () {
   __alignof__(X<length<T>::value>);
 }

template void foo<int>();


Maybe that testcase should also go on the mainline.


Thanks,
Andrew Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]