Proto, 0, Args, NumArgs, AllArgs,
CallType);
ConvertedArgs.append(AllArgs.begin(), AllArgs.end());
+
+ DiagnoseSentinelCalls(Constructor, Loc, AllArgs.data(), AllArgs.size());
+
+ // FIXME: Missing call to CheckFunctionCall or equivalent
+
return Invalid;
}
NumPlaceArgs = AllPlaceArgs.size();
if (NumPlaceArgs > 0)
PlaceArgs = &AllPlaceArgs[0];
+
+ DiagnoseSentinelCalls(OperatorNew, PlacementLParen,
+ PlaceArgs, NumPlaceArgs);
+
+ // FIXME: Missing call to CheckFunctionCall or equivalent
}
// Warn if the type is over-aligned and is being allocated by global operator
RParenLoc))
return ExprError();
+ DiagnoseSentinelCalls(Method, LParenLoc, Args, NumArgs);
+
if (CheckFunctionCall(Method, TheCall))
return ExprError();
if (IsError) return true;
+ DiagnoseSentinelCalls(Method, LParenLoc, Args, NumArgs);
+
if (CheckFunctionCall(Method, TheCall))
return true;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+
void f(int, ...) __attribute__((sentinel));
void g() {
f(1, 2, __null);
}
+
+typedef __typeof__(sizeof(int)) size_t;
+
+struct S {
+ S(int,...) __attribute__((sentinel)); // expected-note {{marked sentinel}}
+ void a(int,...) __attribute__((sentinel)); // expected-note {{marked sentinel}}
+ void* operator new(size_t,...) __attribute__((sentinel)); // expected-note {{marked sentinel}}
+ void operator()(int,...) __attribute__((sentinel)); // expected-note {{marked sentinel}}
+};
+
+void class_test() {
+ S s(1,2,3); // expected-warning {{missing sentinel in function call}}
+ S* s2 = new (1,2,3) S(1, __null); // expected-warning {{missing sentinel in function call}}
+ s2->a(1,2,3); // expected-warning {{missing sentinel in function call}}
+ s(1,2,3); // expected-warning {{missing sentinel in function call}}
+}