if (Arg->isInstantiationDependent()) return false;
if (Arg->HasSideEffects(Context))
- return Diag(Arg->getLocStart(), diag::warn_assume_side_effects)
+ Diag(Arg->getLocStart(), diag::warn_assume_side_effects)
<< Arg->getSourceRange()
<< cast<FunctionDecl>(TheCall->getCalleeDecl())->getIdentifier();
-// RUN: %clang_cc1 %s -triple i386-mingw32 -std=c++11 -fsyntax-only -Wno-unused-getter-return-value -Wno-unused-value -Wmicrosoft -verify -fms-extensions -fms-compatibility -fdelayed-template-parsing
+// RUN: %clang_cc1 %s -triple i386-mingw32 -std=c++14 -fsyntax-only -Wno-unused-getter-return-value -Wno-unused-value -Wmicrosoft -verify -fms-extensions -fms-compatibility -fdelayed-template-parsing
/* Microsoft attribute tests */
[repeatable][source_annotation_attribute( Parameter|ReturnValue )]
typedef void(*ignored_quals_dummy4)(), __thiscall ignored_quals4; // expected-warning {{qualifiers after comma in declarator list are ignored}}
typedef void(*ignored_quals_dummy5)(), __cdecl ignored_quals5; // expected-warning {{qualifiers after comma in declarator list are ignored}}
typedef void(*ignored_quals_dummy6)(), __vectorcall ignored_quals6; // expected-warning {{qualifiers after comma in declarator list are ignored}}
+
+namespace {
+bool f(int);
+template <typename T>
+struct A {
+ constexpr A(T t) {
+ __assume(f(t)); // expected-warning{{the argument to '__assume' has side effects that will be discarded}}
+ }
+ constexpr bool g() { return false; }
+};
+constexpr A<int> h() {
+ A<int> b(0); // expected-note {{in instantiation of member function}}
+ return b;
+}
+static_assert(h().g() == false, "");
+}