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++/71193] New: [6/7 Regression] error: invalid use of incomplete type


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71193

            Bug ID: 71193
           Summary: [6/7 Regression] error: invalid use of incomplete type
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---

Hello.

Starting from r236221, we report a new error for the following snippet (reduced
from Chromium):

$ cat tc.ii
class Heap;
class A {
public:  
  Heap *m_fn1();
};
template <typename> class B : A {
  void m_fn2() { m_fn1()->HashSeed; }
};

$ g++ tc.ii
tc.ii: In member function âvoid B< <template-parameter-1-1> >::m_fn2()â:
tc.ii:7:25: error: invalid use of incomplete type âclass Heapâ
   void m_fn2() { m_fn1()->HashSeed; }
                         ^~
tc.ii:1:7: note: forward declaration of âclass Heapâ
 class Heap;
       ^~~~

GCC 5.3.1 works fine, as well as clang++ 3.7.0

Thanks,
Martin

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