For forward-declared static inline functions, delay CFG-based warnings until we
encounter a definition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99243 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/return.c b/test/Sema/return.c
index fad81ad..fab6a82 100644
--- a/test/Sema/return.c
+++ b/test/Sema/return.c
@@ -227,12 +227,15 @@
// when they are used.
static inline int si_has_missing_return() {} // no-warning
static inline int si_has_missing_return_2() {}; // expected-warning{{control reaches end of non-void function}}
+static inline int si_forward();
static inline int si_has_missing_return_3(int x) {
if (x)
return si_has_missing_return_3(x+1);
} // expected-warning{{control may reach end of non-void function}}
int test_static_inline(int x) {
+ si_forward();
return x ? si_has_missing_return_2() : si_has_missing_return_3(x);
}
+static inline int si_forward() {} // expected-warning{{control reaches end of non-void function}}