add new bad case

This commit is contained in:
Neargye 2018-07-13 20:16:58 +05:00
parent 4d4508bddd
commit 0b0a6e908c

View file

@ -51,6 +51,9 @@ void SomeMethod3() {
std::cout << NAMEOF(SomeMethod3) << " no called!" << std::endl; std::cout << NAMEOF(SomeMethod3) << " no called!" << std::endl;
} }
template <typename T>
void SomeMethod4() {}
struct Long { struct Long {
struct LL { struct LL {
int field; int field;
@ -104,6 +107,7 @@ int main() {
// macros // macros
std::cout << NAMEOF(__LINE__) << std::endl; // __LINE__ std::cout << NAMEOF(__LINE__) << std::endl; // __LINE__
std::cout << NAMEOF(__FILE__) << std::endl; // __FILE__ std::cout << NAMEOF(__FILE__) << std::endl; // __FILE__
// full name // full name
std::cout << NAMEOF_FULL(somevar.somefield) << std::endl; // somevar.somefield std::cout << NAMEOF_FULL(somevar.somefield) << std::endl; // somevar.somefield
std::cout << NAMEOF_FULL(&SomeStruct::SomeMethod2) << std::endl; // &SomeStruct::SomeMethod2 std::cout << NAMEOF_FULL(&SomeStruct::SomeMethod2) << std::endl; // &SomeStruct::SomeMethod2
@ -141,6 +145,7 @@ int main() {
std::cout << NAMEOF(std::string()) << std::endl; // 'string()' std::cout << NAMEOF(std::string()) << std::endl; // 'string()'
std::cout << NAMEOF(std::string{}) << std::endl; // "string{}' std::cout << NAMEOF(std::string{}) << std::endl; // "string{}'
std::cout << NAMEOF(std::string{"test"}) << std::endl; // 'string{"test"}' std::cout << NAMEOF(std::string{"test"}) << std::endl; // 'string{"test"}'
std::cout << NAMEOF(SomeMethod4<int>) << std::endl; // ''
std::cout << NAMEOF(ptrvar[0]) << std::endl; // 'ptrvar[0]' std::cout << NAMEOF(ptrvar[0]) << std::endl; // 'ptrvar[0]'
std::cout << NAMEOF(intvar + intvar) << std::endl; // ' intvar' std::cout << NAMEOF(intvar + intvar) << std::endl; // ' intvar'
std::cout << NAMEOF(NAMEOF(intvar)) << std::endl; // 'NAMEOF(intvar)' std::cout << NAMEOF(NAMEOF(intvar)) << std::endl; // 'NAMEOF(intvar)'