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

             Bug #: 53360
           Summary: Problems with -std=gnu++0x
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: andi...@mail.ru


I have such code:


template<class CppType>
struct make_literal;

template<>
struct make_literal<int> {
  typedef int type;
};

template<class T>
struct make_expression {
  typedef typename make_literal<T>::type type;
};

struct column {
  template<class T>
  typename make_expression<T>::type operator= (const T& t) const {
    return typename make_expression<T>::type(t);
  }
};

struct expression : column
{
    expression() { }
    using column::operator =;
};

int main()
{
    expression ex;
    ex = 2;

    return 0;
}

which failed to compile with such command line:
c++ -std=gnu++0x file.cpp

Compiler produces such error:
bug.cpp: In instantiation of ‘make_expression<column>’:
bug.cpp:31:10:   instantiated from here
bug.cpp:12:42: error: invalid use of incomplete type ‘struct
make_literal<column>’
bug.cpp:3:8: error: declaration of ‘struct make_literal<column>’

Reply via email to