view gcc/testsuite/g++.dg/cpp0x/gen-attrs-70.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 1830386684a0
children
line wrap: on
line source

// PR c++/91304 - prefix attributes ignored in condition.
// { dg-do compile { target c++11 } }
// { dg-additional-options "-Wall -Wextra" }

int f();

void g()
{   
  if ([[maybe_unused]] int i = f()) { }
  if ([[deprecated]] int i = f()) { i = 10; } // { dg-warning ".i. is deprecated" }
  if (int i [[maybe_unused]] = f()) { }
  if (int i [[deprecated]] = f()) { i = 10; } // { dg-warning ".i. is deprecated" }
}