aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaCXX/warn-c++1z-extensions.cpp
blob: a0d44a34ffed1d2eac01989df49ed209fcdc0490 (plain)
1
2
3
4
5
6
7
8
// RUN: %clang_cc1 -fsyntax-only -std=c++14 -verify %s

void f() {
  if (bool b = true; b) {} // expected-warning {{'if' initialization statements are a C++17 extension}}
  switch (int n = 5; n) { // expected-warning {{'switch' initialization statements are a C++17 extension}}
  case 5: break;
  }
}