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++/53360] New: Problems with -std=gnu++0x


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: unassigned@gcc.gnu.org
        ReportedBy: andigor@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>â


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