Improve test coverage for templates with comparison in default value

This commit is contained in:
Dmitry-Me 2020-02-03 18:36:51 +03:00
parent b13ae83845
commit 84f65c40a7
1 changed files with 24 additions and 0 deletions

View File

@ -3136,6 +3136,14 @@ private:
"struct b<1,false> { } ;";
ASSERT_EQUALS(exp, tok(code));
}
{
const char code[] = "template <long a, bool = 0 != a> struct b {};\n"
"b<1> b1;";
const char exp[] = "struct b<1,true> ; "
"b<1,true> b1 ; "
"struct b<1,true> { } ;";
ASSERT_EQUALS(exp, tok(code));
}
{
const char code[] = "template <long a, bool = a < 0> struct b {};\n"
"b<1> b1;";
@ -3152,6 +3160,22 @@ private:
"struct b<1,true> { } ;";
ASSERT_EQUALS(exp, tok(code));
}
{
const char code[] = "template <long a, bool = 0 <= a> struct b {};\n"
"b<1> b1;";
const char exp[] = "struct b<1,true> ; "
"b<1,true> b1 ; "
"struct b<1,true> { } ;";
ASSERT_EQUALS(exp, tok(code));
}
{
const char code[] = "template <long a, bool = a >= 0> struct b {};\n"
"b<1> b1;";
const char exp[] = "struct b<1,true> ; "
"b<1,true> b1 ; "
"struct b<1,true> { } ;";
ASSERT_EQUALS(exp, tok(code));
}
}
void template132() { // #9250