From 1e05e86de5ee43bbaba661e7c5576c1c5a4ff338 Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Tue, 2 Apr 2013 17:55:01 +0000 Subject: [PATCH] Moved fallthrough regression test to switch-implicit-fallthrough.cpp. llvm-svn: 178554 --- .../switch-implicit-fallthrough-regression.cpp | 17 ----------------- .../SemaCXX/switch-implicit-fallthrough.cpp | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 17 deletions(-) delete mode 100644 clang/test/SemaCXX/switch-implicit-fallthrough-regression.cpp diff --git a/clang/test/SemaCXX/switch-implicit-fallthrough-regression.cpp b/clang/test/SemaCXX/switch-implicit-fallthrough-regression.cpp deleted file mode 100644 index aec3769e00e4..000000000000 --- a/clang/test/SemaCXX/switch-implicit-fallthrough-regression.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -Wimplicit-fallthrough %s - -void f() { - class C { - void f(int x) { - switch (x) { - case 0: - x++; - [[clang::fallthrough]]; // expected-no-diagnostics - case 1: - x++; - break; - } - } - }; -} - diff --git a/clang/test/SemaCXX/switch-implicit-fallthrough.cpp b/clang/test/SemaCXX/switch-implicit-fallthrough.cpp index 0f7891dc53c3..d7959238c6b3 100644 --- a/clang/test/SemaCXX/switch-implicit-fallthrough.cpp +++ b/clang/test/SemaCXX/switch-implicit-fallthrough.cpp @@ -247,3 +247,21 @@ int fallthrough_targets(int n) { } return n; } + +// Fallthrough annotations in local classes used to generate "fallthrough +// annotation does not directly precede switch label" warning. +void fallthrough_in_local_class() { + class C { + void f(int x) { + switch (x) { + case 0: + x++; + [[clang::fallthrough]]; // no diagnostics + case 1: + x++; + break; + } + } + }; +} +