public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12288] New: "expected function-definition" error compiling constructor
@ 2003-09-15 17:41 redi at gcc dot gnu dot org
  2003-09-15 19:45 ` [Bug c++/12288] unintelligible error message for constructor declaration with misspelled type bangerth at dealii dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: redi at gcc dot gnu dot org @ 2003-09-15 17:41 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: "expected function-definition" error compiling
                    constructor
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: redi at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i386-unknown-freebsd4.8

The code below fails to compile with CVS g++ from 20030826 (I would have used a
more recent build but I can't bootstrap right now). This code compiles without
error on Comeau. The GCC config info, code and error follow:


$ g++3 -v
Reading specs from
/data/development/jw/gcc3/bin/../lib/gcc/i386-unknown-freebsd4.8/3.4/specs
Configured with: /home/jw/src/cvs/gcc/configure --prefix=/home/jw/gcc3/
--enable-languages=c,c++ --enable-concept-checks --enable-libstdcxx-pch :
(reconfigured) /home/jw/src/cvs/gcc/configure --prefix=/home/jw/gcc3/
--enable-languages=c,c++ --enable-concept-checks --enable-libstdcxx-pch :
(reconfigured)
Thread model: posix
gcc version 3.4 20030826 (experimental)
$ cat gcc_bug.cc
#include <map>

struct Foo {};

typedef std::multimap<unsigned short,Foo> FooMap;

class SameFoo
{
public:
    explicit SameFoo(const FooMap::data_type& lhs) : m_arg(lhs) {}
private:
    const Foo& m_arg;
};

$ g++3 gcc_bug.cc
gcc_bug.cc:10: error: ISO C++ forbids declaration of `SameFoo' with no type
gcc_bug.cc:10: error: only declarations of constructors can be `explicit'
gcc_bug.cc:10: error: expected function-definition


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

end of thread, other threads:[~2013-05-20 17:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-12288-4@http.gcc.gnu.org/bugzilla/>
2013-05-20 14:38 ` [Bug c++/12288] unintelligible error message for constructor declaration with misspelled type paolo.carlini at oracle dot com
2013-05-20 17:15 ` paolo.carlini at oracle dot com
2013-05-20 17:17 ` redi at gcc dot gnu.org
2003-09-15 17:41 [Bug c++/12288] New: "expected function-definition" error compiling constructor redi at gcc dot gnu dot org
2003-09-15 19:45 ` [Bug c++/12288] unintelligible error message for constructor declaration with misspelled type bangerth at dealii dot org
2003-09-16 11:04 ` redi at gcc dot gnu dot org
2003-12-29  0:31 ` pinskia at gcc dot gnu dot org
2004-10-28  2:08 ` pinskia at gcc dot gnu dot 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).