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++/49252] New: Problem with inline


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

           Summary: Problem with inline
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jwillemsen@remedy.nl


Using gcc on OpenSuSE 4.6

g++-4.6 (SUSE Linux) 4.6.0 20110505 [gcc-4_6-branch revision 173419]
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The example program:

#include <string>

namespace Demo {
  class SOne
  {
    std::string text (void) const;
  private:
    std::string text_;

  };
}

inline std::string ::Demo::SOne::text (void) const { return this->text_; }

Gives the error:

johnny@m4500jw:~/ACE/IDL2CPP/test> g++-4.6 -fno-strict-aliasing
-fvisibility=hidden -fvisibility-inlines-hidden -O3 -ggdb -m64 -pthread -Wall
-W -Wpointer-arith -pipe -D_GNU_SOURCE -std=c++0x  -c -o .obj/demoC.o a.cpp
a.cpp:13:8: error: âDemoâ in class âstd::stringâ does not name a type

Removing :: after std::string in the inline method resolves this error


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