David Blaikie | cc5f8f0 | 2011-10-18 05:54:07 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -Wc++11-narrowing -Wmicrosoft -verify -fms-extensions -std=c++11 |
Richard Smith | f86b0ae | 2012-07-28 19:54:11 +0000 | [diff] [blame] | 2 | // 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 Pichet | 4c72694 | 2011-08-18 00:04:08 +0000 | [diff] [blame] | 3 | |
| 4 | |
| 5 | struct A { |
| 6 | unsigned int a; |
| 7 | }; |
| 8 | int b = 3; |
Alp Toker | b086903 | 2014-05-17 01:13:18 +0000 | [diff] [blame] | 9 | A var = { b }; // expected-warning {{ cannot be narrowed }} expected-note {{insert an explicit cast to silence this issue}} |
Richard Smith | f86b0ae | 2012-07-28 19:54:11 +0000 | [diff] [blame] | 10 | |
| 11 | |
| 12 | namespace 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 | } |