本文整理汇总了C++中Foo::setA方法的典型用法代码示例。如果您正苦于以下问题:C++ Foo::setA方法的具体用法?C++ Foo::setA怎么用?C++ Foo::setA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Foo
的用法示例。
在下文中一共展示了Foo::setA方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: func
int func()
{
Bar *bar1, bar2;
Foo local_foo;
int x = x; // { dg-warning "assigned to itself" }
static int y = y; // { dg-warning "assigned to itself" }
float *f;
Bar bar_array[5];
char n;
int overflow;
*f = *f; // { dg-warning "assigned to itself" }
bar1->b_ = bar1->b_; // { dg-warning "assigned to itself" }
bar2.c_ = bar2.c_; // { dg-warning "assigned to itself" }
local_foo = local_foo;
foo = foo;
foo.setA(5);
bar_array[3].c_ = bar_array[3].c_; // { dg-warning "assigned to itself" }
bar_array[x+g].b_ = bar_array[x+g].b_; // { dg-warning "assigned to itself" }
y = x;
x = y;
x += 0; // should not warn
y -= 0; // should not warn
x /= x; // should not warn
y *= y; // should not warn
}
示例2: func
int func()
{
Bar *bar1, bar2;
Foo foo;
int x = x - 0; // should not warn
static int y = y / 1; // should not warn
float *f;
Bar bar_array[5];
*f = *f / 1; // should not warn
bar1->b_ = bar1->b_ * 1; // should not warn
bar2.c_ = bar2.c_ - 0; // should not warn
foo.setA(5);
bar_array[3].c_ = bar_array[3].c_ * 1; // should not warn
bar_array[x+g].b_ = bar_array[x+g].b_ / 1; // should not warn
x += 0;
y -= 0;
foo = foo;
foo.operator=(foo); // should not warn
}
示例3: func
int func()
{
Bar *bar1, bar2;
Foo local_foo;
int x = x; // { dg-bogus "assigned to itself" }
static int y = y; // { dg-bogus "assigned to itself" }
float *f;
Bar bar_array[5];
char n;
int overflow;
*f = *f; // { dg-bogus "assigned to itself" }
bar1->b_ = bar1->b_; // { dg-bogus "assigned to itself" }
bar2.c_ = bar2.c_; // { dg-bogus "assigned to itself" }
local_foo = local_foo; // { dg-bogus "assigned to itself" }
foo = foo; // { dg-bogus "assigned to itself" }
foo.setA(5);
bar_array[3].c_ = bar_array[3].c_; // { dg-bogus "assigned to itself" }
bar_array[x+g].b_ = bar_array[x+g].b_; // { dg-bogus "self-assignment detected" }
y = x;
x = y;
}