OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Wunused-var-10.C] - Rev 693

Compare with Previous | Blame | View Log

// PR c++/44412
// { dg-do compile }
// { dg-options "-Wunused" }

struct S
{
  static const int a = 3;
  static int b;
  int c;
};

const int S::a;
int S::b = 4;

int
f1 ()
{
  S s;
  return s.a;
}

int
f2 ()
{
  S s;
  return s.b;
}

void
f3 ()
{
  S s;          // { dg-warning "set but not used" }
  s.c = 6;
}

int
f4 ()
{
  S s;
  s.c = 6;
  return s.c;
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.