https://llvm.org/bugs/show_bug.cgi?id=25306
Bug ID: 25306 Summary: __attribute__((returns_nonnull)) does not work for std::add_pointer_t<T> Product: clang Version: 3.7 Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: Frontend Assignee: unassignedclangb...@nondot.org Reporter: frankhb1...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Case: // clang++ -std=c++14 a.cc #include <type_traits> template<typename T> __attribute__((returns_nonnull)) std::add_pointer_t<T> t() { static T obj; return &obj; } int main() {} Diagnostics: a.cc:4:16: warning: 'returns_nonnull' attribute only applies to return values that are pointers [-Wignored-attributes] __attribute__((returns_nonnull)) std::add_pointer_t<T> t() On the other hand, G++ works. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs