astyle formatting

[ci skip]
This commit is contained in:
Daniel Marjamäki 2018-10-28 17:37:19 +01:00
parent 2b6cc33dc6
commit 8beb42cc90
2 changed files with 22 additions and 22 deletions

View File

@ -170,7 +170,7 @@ void TemplateSimplifier::checkComplicatedSyntaxErrorsInTemplates()
// parse this statement and see if the '<' and '>' are matching
unsigned int level = 0;
for (const Token *tok2 = tok; tok2 && !Token::simpleMatch(tok2, ";"); tok2 = tok2->next()) {
if(Token::simpleMatch(tok2, "{") && (!Token::Match(tok2->previous(), ">|%type%") || Token::simpleMatch(tok2->link(), "} ;")))
if (Token::simpleMatch(tok2, "{") && (!Token::Match(tok2->previous(), ">|%type%") || Token::simpleMatch(tok2->link(), "} ;")))
break;
if (tok2->str() == "(")
tok2 = tok2->link();

View File

@ -8653,33 +8653,33 @@ private:
void checkEnableIf() {
ASSERT_NO_THROW(tokenizeAndStringify(
"template<\n"
" typename U,\n"
" typename std::enable_if<\n"
" std::is_convertible<U, T>{}>::type* = nullptr>\n"
"void foo(U x);\n"))
"template<\n"
" typename U,\n"
" typename std::enable_if<\n"
" std::is_convertible<U, T>{}>::type* = nullptr>\n"
"void foo(U x);\n"))
ASSERT_NO_THROW(tokenizeAndStringify(
"template<class t>\n"
"T f(const T a, const T b) {\n"
" return a < b ? b : a;\n"
"}\n"))
"template<class t>\n"
"T f(const T a, const T b) {\n"
" return a < b ? b : a;\n"
"}\n"))
ASSERT_NO_THROW(tokenizeAndStringify(
"template<class T>\n"
"struct A {\n"
" T f(const T a, const T b) {\n"
" return a < b ? b : a;\n"
" }\n"
"};\n"))
"template<class T>\n"
"struct A {\n"
" T f(const T a, const T b) {\n"
" return a < b ? b : a;\n"
" }\n"
"};\n"))
ASSERT_NO_THROW(tokenizeAndStringify(
"const int a = 1;\n"
"const int b = 2;\n"
"template<class T>\n"
"struct A {\n"
" int x = a < b ? b : a;"
"};\n"))
"const int a = 1;\n"
"const int b = 2;\n"
"template<class T>\n"
"struct A {\n"
" int x = a < b ? b : a;"
"};\n"))
}