Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-11205

c7x_scalable.h template element_count_of does not support const types

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium

      The attached test case has these lines ...

            char4 regular_vec = char4(1);
      const char4 const_vec   = char4(2);
      
      void fxn()
      {
         PrintVector("regular_vec", regular_vec);  // builds clean
         PrintVector("const_vec",   const_vec);    // gets error diagnostic
      }
      

      PrintVector is a template with this line in it ...

          int count = c7x::element_count_of<T>::value;
      

      Build it ...

      % cl7x file.cpp
      "file.cpp", line 10: error: class "c7x::element_count_of<const char4>" has no member "value"
                detected during instantiation of "void PrintVector(std::__2::string, T &) [with T=const char4]" at line 28
      1 error detected in the compilation of "file.cpp".
      
      >> Compilation failure
      

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: