#6628 False positive: The extra qualification 'namespace::' is unnecessary and is considered an error by many compilers. Add regression test since that issue has been fixed in 1.69 already

This commit is contained in:
Alexander Mai 2015-07-26 06:54:46 +02:00
parent 473336f986
commit 12eb3ae716
1 changed files with 16 additions and 0 deletions

View File

@ -259,6 +259,7 @@ private:
TEST_CASE(removeUnnecessaryQualification14);
TEST_CASE(removeUnnecessaryQualification15);
TEST_CASE(removeUnnecessaryQualification16);
TEST_CASE(removeUnnecessaryQualification17);
TEST_CASE(simplifyVarDecl1); // ticket # 2682 segmentation fault
TEST_CASE(simplifyVarDecl2); // ticket # 2834 segmentation fault
@ -4132,6 +4133,21 @@ private:
ASSERT_EQUALS("[test.cpp:3]: (portability) The extra qualification 'Fred::' is unnecessary and is considered an error by many compilers.\n", errout.str());
}
void removeUnnecessaryQualification17() { // #6628 False positive: The extra qualification 'namespace::' is unnecessary and is considered an error by many compilers.
const char code[] = "namespace my_application {\n"
" std::string version();\n"
"}\n"
"namespace my_application_test {\n"
" class my_application {\n"
" void version() {\n"
" std::string version = ::my_application::version();\n"
" }\n"
" };\n"
"}";
tok(code, false);
ASSERT_EQUALS("", errout.str());
}
void simplifyVarDecl1() { // ticket # 2682 segmentation fault
const char code[] = "x a[0] =";
tok(code, false);