diff options
Diffstat (limited to 'clang/test/SemaTemplate/deduction.cpp')
| -rw-r--r-- | clang/test/SemaTemplate/deduction.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/deduction.cpp b/clang/test/SemaTemplate/deduction.cpp index be86f18729d..64fef8e5f52 100644 --- a/clang/test/SemaTemplate/deduction.cpp +++ b/clang/test/SemaTemplate/deduction.cpp @@ -539,3 +539,10 @@ namespace dependent_list_deduction { #endif } } + +namespace designators { + template<typename T, int N> constexpr int f(T (&&)[N]) { return N; } // expected-note 2{{couldn't infer template argument 'T'}} + static_assert(f({1, 2, [20] = 3}) == 3, ""); // expected-error {{no matching function}} expected-warning 2{{C99}} expected-note {{}} + + static_assert(f({.a = 1, .b = 2}) == 3, ""); // expected-error {{no matching function}} +} |

