2011-10-18 13:54:07 +08:00
|
|
|
// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -Wc++11-narrowing -Wmicrosoft -verify -fms-extensions -std=c++11
|
2012-07-29 03:54:11 +08:00
|
|
|
// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -Wc++11-narrowing -Wmicrosoft -verify -fms-extensions -std=c++11 -fms-compatibility -DMS_COMPAT
|
2011-08-18 08:04:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
struct A {
|
|
|
|
unsigned int a;
|
|
|
|
};
|
|
|
|
int b = 3;
|
|
|
|
A var = { b }; // expected-warning {{ cannot be narrowed }} expected-note {{override}}
|
2012-07-29 03:54:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
namespace PR13433 {
|
|
|
|
struct S;
|
|
|
|
S make();
|
|
|
|
|
|
|
|
template<typename F> auto x(F f) -> decltype(f(make()));
|
|
|
|
#ifndef MS_COMPAT
|
|
|
|
// expected-error@-2{{calling 'make' with incomplete return type 'PR13433::S'}}
|
|
|
|
// expected-note@-5{{'make' declared here}}
|
|
|
|
// expected-note@-7{{forward declaration of 'PR13433::S'}}
|
|
|
|
#endif
|
|
|
|
}
|