blob: c977389a2e4eed8cbd9419142ca2d83faa5d8b02 [file] [log] [blame]
// PR c++/105035
// { dg-do compile }
// { dg-options "-Wduplicated-cond" }
class A {
struct B { int c; int f; } e;
template <typename> void foo ();
void bar ();
};
template <typename> void
A::foo ()
{
int g;
if (&g == &e.c)
;
else if (&g == &e.f)
;
}
void
A::bar ()
{
int g;
if (&g == &e.c) // { dg-message "previously used here" }
;
else if (&g == &e.c) // { dg-warning "duplicated 'if' condition" }
;
}