Fixed #1713 (remove Microsoft variants of inline)
This commit is contained in:
parent
26a7d29760
commit
3fb0260ef1
|
@ -1693,14 +1693,14 @@ bool Tokenizer::tokenize(std::istream &code, const char FileName[], const std::s
|
||||||
Token::createMutualLinks(tok->tokAt(2), tok->tokAt(3));
|
Token::createMutualLinks(tok->tokAt(2), tok->tokAt(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove "volatile", "inline" and register
|
// Remove "volatile", "inline" and "register"
|
||||||
while (Token::Match(_tokens, "volatile|inline|register"))
|
while (Token::Match(_tokens, "volatile|inline|__inline|__forceinline|register"))
|
||||||
{
|
{
|
||||||
_tokens->deleteThis();
|
_tokens->deleteThis();
|
||||||
}
|
}
|
||||||
for (Token *tok = _tokens; tok; tok = tok->next())
|
for (Token *tok = _tokens; tok; tok = tok->next())
|
||||||
{
|
{
|
||||||
while (Token::Match(tok->next(), "volatile|inline|register"))
|
while (Token::Match(tok->next(), "volatile|inline|__inline|__forceinline|register"))
|
||||||
{
|
{
|
||||||
tok->deleteNext();
|
tok->deleteNext();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5089,6 +5089,8 @@ private:
|
||||||
ASSERT_EQUALS("int var ;", tok("register int var ;", true));
|
ASSERT_EQUALS("int var ;", tok("register int var ;", true));
|
||||||
ASSERT_EQUALS("short var ;", tok("register short int var ;", true));
|
ASSERT_EQUALS("short var ;", tok("register short int var ;", true));
|
||||||
ASSERT_EQUALS("int foo ( ) { }", tok("inline int foo ( ) { }", true));
|
ASSERT_EQUALS("int foo ( ) { }", tok("inline int foo ( ) { }", true));
|
||||||
|
ASSERT_EQUALS("int foo ( ) { }", tok("__inline int foo ( ) { }", true));
|
||||||
|
ASSERT_EQUALS("int foo ( ) { }", tok("__forceinline int foo ( ) { }", true));
|
||||||
ASSERT_EQUALS("if ( a ) { }", tok("if ( likely ( a ) ) { }", true));
|
ASSERT_EQUALS("if ( a ) { }", tok("if ( likely ( a ) ) { }", true));
|
||||||
ASSERT_EQUALS("if ( a ) { }", tok("if ( unlikely ( a ) ) { }", true));
|
ASSERT_EQUALS("if ( a ) { }", tok("if ( unlikely ( a ) ) { }", true));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue