return false;
} else {
// 'static inline' functions are defined in headers; don't warn.
- if (FD->isInlineSpecified() &&
- !isMainFileLoc(*this, FD->getLocation()))
+ if (FD->isInlined() && !isMainFileLoc(*this, FD->getLocation()))
return false;
}
}
// Only warn for unused decls internal to the translation unit.
+ // FIXME: This seems like a bogus check; it suppresses -Wunused-function
+ // for inline functions defined in the main source file, for instance.
return mightHaveNonExternalLinkage(D);
}
inline void bar(int, int) { }
};
+namespace pr19713 {
+#if __cplusplus >= 201103L
+ static constexpr int constexpr1() { return 1; }
+ constexpr int constexpr2() { return 2; }
+#endif
+}
+
#else
#define HEADER
#include "warn-unused-filescoped.cpp"
static void func() {}
}
+namespace pr19713 {
+#if __cplusplus >= 201103L
+ // FIXME: We should warn on both of these.
+ static constexpr int constexpr3() { return 1; } // expected-warning {{unused}}
+ constexpr int constexpr4() { return 2; }
+#endif
+}
+
#endif