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

            Bug ID: 94610
           Summary: 'invalid use of incomplete type' error which show an
                    alias, but without the real type
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jonathan.poelen at gmail dot com
  Target Milestone: ---

class X;

template<class>
using something = X;

something<int> a;
something<int> b = 1;



$ g++ test.cpp

test.cpp:6:16: error: aggregate ‘something<int> a’ has incomplete type and
cannot be defined
    6 | something<int> a;
      |                ^
test.cpp:7:16: error: variable ‘something<int> b’ has initializer but
incomplete type
    7 | something<int> b = 1;
      |                ^



The real type of something<int> is missing. Expected:

    error: aggregate ‘something<int> a’ {aka ‘X’} has incomplete type and
cannot be defined

and

    error: variable ‘something<int> b’ {aka ‘X’} has initializer but incomplete
type

Reply via email to