parent
d19bb758bd
commit
e4c5f36af0
|
@ -1234,7 +1234,7 @@ void Tokenizer::simplifyTypedef()
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for typedef that can be substituted
|
// check for typedef that can be substituted
|
||||||
else if ((tok2->isNameOnly() || (tok2->isName() && tok2->isExpandedMacro())) &&
|
else if ((tok2->isNameOnly() || (tok2->isName() && (tok2->isExpandedMacro() || tok2->isInline()))) &&
|
||||||
(Token::simpleMatch(tok2, pattern.c_str(), pattern.size()) ||
|
(Token::simpleMatch(tok2, pattern.c_str(), pattern.size()) ||
|
||||||
(inMemberFunc && tok2->str() == typeName->str()))) {
|
(inMemberFunc && tok2->str() == typeName->str()))) {
|
||||||
// member function class variables don't need qualification
|
// member function class variables don't need qualification
|
||||||
|
|
|
@ -397,14 +397,19 @@ private:
|
||||||
" typedef float float_t ;\n"
|
" typedef float float_t ;\n"
|
||||||
" inline VL::float_t fast_atan2(VL::float_t y, VL::float_t x){}\n"
|
" inline VL::float_t fast_atan2(VL::float_t y, VL::float_t x){}\n"
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
const char expected[] =
|
const char expected[] =
|
||||||
"namespace VL { "
|
"namespace VL { "
|
||||||
""
|
""
|
||||||
"float fast_atan2 ( float y , float x ) { } "
|
"float fast_atan2 ( float y , float x ) { } "
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
ASSERT_EQUALS(expected, tok(code, false));
|
ASSERT_EQUALS(expected, tok(code, false));
|
||||||
|
|
||||||
|
// ticket #11373
|
||||||
|
const char code1[] =
|
||||||
|
"typedef int foo;\n"
|
||||||
|
"inline foo f();\n";
|
||||||
|
const char expected1[] = "int f ( ) ;";
|
||||||
|
ASSERT_EQUALS(expected1, tok(code1, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
void simplifyTypedef7() {
|
void simplifyTypedef7() {
|
||||||
|
|
Loading…
Reference in New Issue