This commit is contained in:
parent
0934577dda
commit
5ee6c2138c
|
@ -9390,7 +9390,7 @@ void Tokenizer::simplifyAsm2()
|
|||
if (tok->str() != "^")
|
||||
continue;
|
||||
|
||||
if (Token::simpleMatch(tok, "^ {") || Token::simpleMatch(tok->linkAt(1), ") {")) {
|
||||
if (Token::simpleMatch(tok, "^ {") || (Token::simpleMatch(tok->linkAt(1), ") {") && tok->strAt(-1) != "operator")) {
|
||||
Token * start = tok;
|
||||
while (start && !Token::Match(start, "[,(;{}=]")) {
|
||||
if (start->link() && Token::Match(start, ")|]|>"))
|
||||
|
|
|
@ -1130,6 +1130,30 @@ private:
|
|||
tokenizeAndStringify("; return f(^(void){somecode});"));
|
||||
ASSERT_EQUALS("; asm ( \"a?(b?(c,asm(\"^{}\")):0):^{}\" ) ;",
|
||||
tokenizeAndStringify(";a?(b?(c,^{}):0):^{};"));
|
||||
ASSERT_EQUALS("template < typename T > "
|
||||
"CImg < T > operator| ( const char * const expression , const CImg < T > & img ) { "
|
||||
"return img | expression ; "
|
||||
"} "
|
||||
"template < typename T > "
|
||||
"CImg < T > operator^ ( const char * const expression , const CImg < T > & img ) { "
|
||||
"return img ^ expression ; "
|
||||
"} "
|
||||
"template < typename T > "
|
||||
"CImg < T > operator== ( const char * const expression , const CImg < T > & img ) { "
|
||||
"return img == expression ; "
|
||||
"}",
|
||||
tokenizeAndStringify("template < typename T >"
|
||||
"inline CImg<T> operator|(const char *const expression, const CImg<T>& img) {"
|
||||
" return img | expression ;"
|
||||
"}"
|
||||
"template<typename T>"
|
||||
"inline CImg<T> operator^(const char *const expression, const CImg<T>& img) {"
|
||||
" return img ^ expression;"
|
||||
"}"
|
||||
"template<typename T>"
|
||||
"inline CImg<T> operator==(const char *const expression, const CImg<T>& img) {"
|
||||
" return img == expression;"
|
||||
"}"));
|
||||
}
|
||||
|
||||
void ifAddBraces1() {
|
||||
|
|
Loading…
Reference in New Issue