2 Replies Latest reply on Mar 26, 2012 3:32 PM by qneill

    GCC 4.3.2 Bug

    Methylene
      Anyone else exprience this?

      It's strange, I don't remember installing gcc updates until this morning, and last night I was getting this error after trying to revert to the 1.1 sdk.

      /usr/include/brook/brtvector.hpp error: explicit template specialization cannot have a storage class        BrookTerrain    line 190-195

      The bug is simple, in some newer versions of GCC you cannot use the static keyword in a template...  I'm not sure how this effects anything, but I haven't had any problems yet.

      Simply removing the static key word around line 188 in brook/brtvector.hpp in your includes directory is a fix.

      Or you can patch with this using patch -p0 in the brook include directory...

        • GCC 4.3.2 Bug
          Poozon

          I had the same problem. I just use GCC 4.2 and these compilation errors do not occur in this version of GCC.

            • Re: GCC 4.3.2 Bug
              qneill

              From http://gcc.gnu.org/gcc-4.3/porting_to.html:

               

              Explicit template specialization cannot have a storage class

               

              Specializations of templates cannot explicitly specify a storage class, and
              have the same storage as the primary template. This is a change from previous
              behavior, based on the feedback and commentary as part of the ISO C++ Core
              Defect Report 605.

              template<typename T> static void foo();  template<> static void foo<void>(); 

               

              Gives:

              error: explicit template specialization cannot have a storage class 

               

              This also happens with the extern specifier. Fixing this is
              easy: just remove any storage specifier on the specialization. Like so:

              template<typename T> static void foo();  template<> void foo<void>();