C++11 那么,如何修复这个简单的RAII close调用程序上的警告呢?

C++11 那么,如何修复这个简单的RAII close调用程序上的警告呢?,c++11,gcc,C++11,Gcc,所以我得到了这个警告: warning: ignoring attributes on template argument ‘int (*)(DIR*) {aka int (*)(__dirstream*)}’ [-Wignored-attributes] std::unique_ptr<DIR, decltype(closedir)*> cd(od, closedir); 那么,declspec为什么不把这个属性复制过来呢?我如何让它闭嘴,而不写一些难看的东西呢 为c+

所以我得到了这个警告:

warning: ignoring attributes on template argument ‘int (*)(DIR*) {aka int (*)(__dirstream*)}’ [-Wignored-attributes]
     std::unique_ptr<DIR, decltype(closedir)*> cd(od, closedir);
那么,declspec为什么不把这个属性复制过来呢?我如何让它闭嘴,而不写一些难看的东西呢

为c++11发布,但我很高兴听到“他们稍后会修复它”

/* Close the directory stream DIRP.
   Return 0 if successful, -1 if not.

   This function is a possible cancellation point and therefore not
   marked with __THROW.  */
extern int closedir (DIR *__dirp) __nonnull ((1));