Improve test coverage for templates with comparison in default value
This commit is contained in:
parent
b13ae83845
commit
84f65c40a7
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue