Пример #1
0
int main()
{
    printf("Foo:\n");
    Foo(1, -2, 3, -4, 5, -6, 7, -8, 9, -10, 11, -12, 13);
    printf("\nFoo1:\n");
    Foo1(-1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13);
    printf("\nFoo2:\n");
    Foo2(-1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13);
}
Пример #2
0
void Bar ()
{
  Foo1 (&Baz); // { dg-message "required from here" }

  Foo2 (&Baz);

  Foo3 (&Baz);

  Foo3 (&Baz, &Baz);
}
Пример #3
0
void Bar ()
{
  Foo1 (&Baz); // #1

  Foo2 (&Baz);

  Foo3 (&Baz);

  Foo3 (&Baz, &Baz); // { dg-error "no matching function" "" }
  // { dg-message "candidate" "candidate note" { target *-*-* } 21 }
}
Пример #4
0
int main () {

  int x = 1;

  //Bar bar0(Foo0(x), Foo1(x), Foo2(x)); // Does not work: conflicting declaration ‘Foo1 x’ previous declaration as ‘Foo0 x’; conflicting declaration ‘Foo2 x’ previous declaration as ‘Foo0 x’
  //Bar bar1(Foo0{x}, Foo1(x), Foo2(x)); // Works WTF
  //Bar bar2(Foo0(x), Foo1{x}, Foo2(x)); // Works WTF
  Bar bar3(Foo0(x), Foo1(x), Foo2{x}); // Does not work: conflicting declaration ‘Foo1 x’ previous declaration as ‘Foo0 x’
  //Bar bar4(Foo0{x}, Foo1{x}, Foo2{x}); // Works totally makes sens to me

  //x.doStuff(); //Dose not work. This makes sens to me. But in the context its curious though.
}
Пример #5
0
TEST( Hit_Check_Test, RectHitChangeRate ){
	wing::DefaltLoader Loader;
	auto img = Loader.load();

	TestSprite Hoge(100,100, img, wing::Position(0, 0), 80);
	TestSprite Foo(100,100, img, wing::Position(70, 70), 100);

	ASSERT_EQ(wing::sprite::checkRectHit(Hoge, Hoge) , false);



	ASSERT_EQ(wing::sprite::checkRectHit(Hoge, Foo) , true);
	ASSERT_EQ(wing::sprite::checkRectHit(Foo, Hoge) , true);

	TestSprite Foo1(100,100,img, wing::Position(90,70), 100);

	ASSERT_EQ(wing::sprite::checkRectHit(Hoge, Foo1) , false);
	ASSERT_EQ(wing::sprite::checkRectHit(Foo1, Hoge) , false);

	TestSprite Foo2(100,100,img, wing::Position(70,90), 100);

	ASSERT_EQ(wing::sprite::checkRectHit(Hoge, Foo2) , false);
	ASSERT_EQ(wing::sprite::checkRectHit(Foo2, Hoge) , false);

	TestSprite Foo3(5, 5, img);

	ASSERT_EQ(wing::sprite::checkRectHit(Hoge, Foo3) , false);
	ASSERT_EQ(wing::sprite::checkRectHit(Foo3, Hoge) , false);

	TestSprite Foo4(5, 5, img, wing::Position(10,10));

	ASSERT_EQ(wing::sprite::checkRectHit(Hoge, Foo4) , true);
	ASSERT_EQ(wing::sprite::checkRectHit(Foo4, Hoge) , true);


}
Пример #6
0
 void f() {
   (void)(true ? Bar() : Foo1()); // okay
   (void)(true ? Bar() : Foo2()); // okay
   (void)(true ? Bar() : Foo3()); // expected-error{{no viable constructor copying temporary}}
 }