blob: 58ab940f583ea7f395e0a91024ddc361c6d9db02 [file] [log] [blame]
David Blaikiecc5f8f02011-10-18 05:54:07 +00001// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -Wc++11-narrowing -Wmicrosoft -verify -fms-extensions -std=c++11
Richard Smithf86b0ae2012-07-28 19:54:11 +00002// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -Wc++11-narrowing -Wmicrosoft -verify -fms-extensions -std=c++11 -fms-compatibility -DMS_COMPAT
Francois Pichet4c726942011-08-18 00:04:08 +00003
4
5struct A {
6 unsigned int a;
7};
8int b = 3;
Alp Tokerb0869032014-05-17 01:13:18 +00009A var = { b }; // expected-warning {{ cannot be narrowed }} expected-note {{insert an explicit cast to silence this issue}}
Richard Smithf86b0ae2012-07-28 19:54:11 +000010
11
12namespace PR13433 {
13 struct S;
14 S make();
15
16 template<typename F> auto x(F f) -> decltype(f(make()));
17#ifndef MS_COMPAT
18// expected-error@-2{{calling 'make' with incomplete return type 'PR13433::S'}}
19// expected-note@-5{{'make' declared here}}
20// expected-note@-7{{forward declaration of 'PR13433::S'}}
21#endif
22}