This is the mail archive of the gcc-bugs@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]

[Bug c++/31708] New: threadprivate with function block static reports incomplete type


Yesterday (2007-4-25) I downloaded gcc 4.2 and ran into a problem with g++
as illustrated here:

     template<class T>
     struct xyz {
        T x, y, z;
     };

     template<class T>
     struct myclass {
        void fun(void);
     };

     template<class T>
     void myclass<T>::fun(void)
     {
        static xyz<T> var;
        #ifdef _OPENMP
           #pragma omp threadprivate(var)
        #endif
     }

     int main(void)
     {
     }

% g++ -fopenmp code.cc
code.cc: In member function 'void myclass<T>::fun()':
code.cc:16: error: 'threadprivate' 'var' has incomplete type

Perhaps I'm missing something, but I don't see how var's type can
be incomplete in this example.

Note: compiles if either or both of xyz and myclass is a non-template,
so this doesn't seem to be the same problem reported in 27557.


-- 
           Summary: threadprivate with function block static reports
                    incomplete type
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mstaley at lanl dot gov


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


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