public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53360] New: Problems with -std=gnu++0x
@ 2012-05-15 13:12 andigor at mail dot ru
  2012-05-15 15:15 ` [Bug c++/53360] " marc.glisse at normalesup dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: andigor at mail dot ru @ 2012-05-15 13:12 UTC (permalink / raw)
  To: gcc-bugs

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>’


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-05  9:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-15 13:12 [Bug c++/53360] New: Problems with -std=gnu++0x andigor at mail dot ru
2012-05-15 15:15 ` [Bug c++/53360] " marc.glisse at normalesup dot org
2021-08-05  6:04 ` [Bug c++/53360] g++ prints 'invalid use of incomplete type' error when compiling code with -std=gnu++0x and newer pinskia at gcc dot gnu.org
2021-08-05  9:12 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).