This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49252] New: Problem with inline
- From: "jwillemsen at remedy dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 1 Jun 2011 10:11:54 +0000
- Subject: [Bug c++/49252] New: Problem with inline
- Auto-submitted: auto-generated
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