Richard Smith | fccb512 | 2016-10-18 20:27:16 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -std=c++14 -verify %s |
2 | |||||
3 | void f() { | ||||
Richard Smith | cbaaa29 | 2017-08-13 22:26:53 +0000 | [diff] [blame] | 4 | if (bool b = true; b) {} // expected-warning {{'if' initialization statements are a C++17 extension}} |
5 | switch (int n = 5; n) { // expected-warning {{'switch' initialization statements are a C++17 extension}} | ||||
Richard Smith | fccb512 | 2016-10-18 20:27:16 +0000 | [diff] [blame] | 6 | case 5: break; |
7 | } | ||||
8 | } |