2013-08-16 11:31:59 +02:00
|
|
|
// Copyright header
|
|
|
|
|
2013-08-16 12:09:50 +02:00
|
|
|
#define GENERATE_FUNC void myFunctionGenerated() {}
|
|
|
|
|
2013-08-16 11:31:59 +02:00
|
|
|
//
|
|
|
|
// Symbols in a global namespace
|
|
|
|
//
|
|
|
|
|
2013-08-16 12:09:50 +02:00
|
|
|
GENERATE_FUNC
|
|
|
|
|
2013-08-16 11:31:59 +02:00
|
|
|
int myVariable;
|
|
|
|
|
|
|
|
int myFunction(bool yesno, int number) {}
|
|
|
|
|
|
|
|
enum MyEnum { V1, V2 };
|
|
|
|
|
|
|
|
class MyClass
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MyClass() {}
|
2013-09-12 14:32:19 +02:00
|
|
|
int functionDeclaredOnly();
|
|
|
|
int functionDefinedInClass(bool yesno, int number) {}
|
2013-09-12 14:06:36 +02:00
|
|
|
int functionDefinedOutSideClass(char c);
|
2013-08-16 11:31:59 +02:00
|
|
|
};
|
|
|
|
|
2013-09-12 14:06:36 +02:00
|
|
|
int MyClass::functionDefinedOutSideClass(char c) {}
|
|
|
|
|
2013-08-16 11:31:59 +02:00
|
|
|
//
|
|
|
|
// Symbols in a named namespace
|
|
|
|
//
|
|
|
|
|
|
|
|
namespace MyNamespace {
|
|
|
|
|
|
|
|
int myVariable;
|
|
|
|
|
|
|
|
int myFunction(bool yesno, int number) {}
|
|
|
|
|
|
|
|
enum MyEnum { V1, V2 };
|
|
|
|
|
|
|
|
class MyClass
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MyClass() {}
|
2013-09-12 14:32:19 +02:00
|
|
|
int functionDeclaredOnly();
|
|
|
|
int functionDefinedInClass(bool yesno, int number) {}
|
2013-09-12 14:06:36 +02:00
|
|
|
int functionDefinedOutSideClass(char c);
|
|
|
|
int functionDefinedOutSideClassAndNamespace(float x);
|
2013-08-16 11:31:59 +02:00
|
|
|
};
|
|
|
|
|
2013-09-12 14:06:36 +02:00
|
|
|
int MyClass::functionDefinedOutSideClass(char c) {}
|
|
|
|
|
2013-08-16 11:31:59 +02:00
|
|
|
} // namespace MyNamespace
|
|
|
|
|
2013-09-12 14:06:36 +02:00
|
|
|
int MyNamespace::MyClass::functionDefinedOutSideClassAndNamespace(float x) {}
|
|
|
|
|
2013-08-16 11:31:59 +02:00
|
|
|
//
|
|
|
|
// Symbols in an anonymous namespace
|
|
|
|
//
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
int myVariable;
|
|
|
|
|
|
|
|
int myFunction(bool yesno, int number) {}
|
|
|
|
|
|
|
|
enum MyEnum { V1, V2 };
|
|
|
|
|
|
|
|
class MyClass
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MyClass() {}
|
2013-09-12 14:32:19 +02:00
|
|
|
int functionDeclaredOnly();
|
|
|
|
int functionDefinedInClass(bool yesno, int number) {}
|
2013-09-12 14:06:36 +02:00
|
|
|
int functionDefinedOutSideClass(char c);
|
2013-08-16 11:31:59 +02:00
|
|
|
};
|
|
|
|
|
2013-09-12 14:06:36 +02:00
|
|
|
int MyClass::functionDefinedOutSideClass(char c) {}
|
|
|
|
|
2013-08-16 11:31:59 +02:00
|
|
|
} // anonymous namespace
|
2013-09-12 14:06:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
int main() {}
|