1bf13895aSDouglas Gregor // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
251e77d5aSDouglas Gregor
f0()351e77d5aSDouglas Gregor void f0() {
451e77d5aSDouglas Gregor int &ir = { 17 }; // expected-error{{reference to type 'int' cannot bind to an initializer list}}
551e77d5aSDouglas Gregor }
6bf13895aSDouglas Gregor
7bf13895aSDouglas Gregor namespace PR12453 {
8bf13895aSDouglas Gregor template<typename T>
f(int i)9bf13895aSDouglas Gregor void f(int i) {
10bf13895aSDouglas Gregor T x{i}; // expected-error{{non-constant-expression cannot be narrowed from type 'int' to 'float' in initializer list}} \
11*b0869036SAlp Toker // expected-note{{insert an explicit cast to silence this issue}}
12bf13895aSDouglas Gregor T y{i}; // expected-error{{non-constant-expression cannot be narrowed from type 'int' to 'float' in initializer list}} \
13*b0869036SAlp Toker // expected-note{{insert an explicit cast to silence this issue}}
14bf13895aSDouglas Gregor }
15bf13895aSDouglas Gregor
16bf13895aSDouglas Gregor template void f<float>(int); // expected-note{{in instantiation of function template specialization 'PR12453::f<float>' requested here}}
17bf13895aSDouglas Gregor }
18