blob: 2e2affb0cfdea1f9dd1a283da89c574fd48e4e96 [file] [log] [blame]
Richard Smith7532d372017-03-22 01:49:19 +00001// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -Wimplicit-fallthrough %s
2// expected-no-diagnostics
3
4template<bool param>
5int fallthrough_template(int i)
6{
7 switch (i) {
8 case 1:
9 if (param)
10 return 3;
11 [[clang::fallthrough]]; // no warning here, for an unreachable annotation (in the fallthrough_template<true> case) in a template function
12 case 2:
13 return 4;
14 default:
15 return 5;
16 }
17}
18
19template int fallthrough_template<true>(int);
20