This commit is contained in:
parent
224a41361d
commit
2840173a72
|
@ -2040,6 +2040,10 @@ bool Tokenizer::simplifyUsing()
|
|||
continue;
|
||||
}
|
||||
|
||||
// skip enum definitions
|
||||
if (tok1->str() == "enum")
|
||||
skipEnumBody(&tok1);
|
||||
|
||||
// check for member function and adjust scope
|
||||
if (isMemberFunction(tok1)) {
|
||||
if (!scope1.empty())
|
||||
|
|
|
@ -75,6 +75,7 @@ private:
|
|||
TEST_CASE(tokenize35); // #8361
|
||||
TEST_CASE(tokenize36); // #8436
|
||||
TEST_CASE(tokenize37); // #8550
|
||||
TEST_CASE(tokenize38); // #9569
|
||||
|
||||
TEST_CASE(validate);
|
||||
|
||||
|
@ -882,6 +883,12 @@ private:
|
|||
ASSERT_EQUALS(expS, tokenizeAndStringify(codeS));
|
||||
}
|
||||
|
||||
void tokenize38() { // #9569
|
||||
const char code[] = "using Binary = std::vector<char>; enum Type { Binary };";
|
||||
const char exp[] = "enum Type { Binary } ;";
|
||||
ASSERT_EQUALS(exp, tokenizeAndStringify(code));
|
||||
}
|
||||
|
||||
void validate() {
|
||||
// C++ code in C file
|
||||
ASSERT_THROW(tokenizeAndStringify(";using namespace std;",false,false,Settings::Native,"test.c"), InternalError);
|
||||
|
|
Loading…
Reference in New Issue