[Bug c++/62223] New: error: there are no arguments to ‘static_asssert’ that depend on a template parameter?=,=?UTF-8?Q? so a declaration of ‘static_asssert’ must be available

tower120 at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Aug 22 07:25:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62223

            Bug ID: 62223
           Summary: error: there are no arguments to ‘static_asssert’ that
                    depend on a template parameter, so a declaration of
                    ‘static_asssert’ must be available
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tower120 at gmail dot com

May be not a bug... But, why error occurs in the following code?

#include <tuple>
#include <utility>
using namespace std;

template<class ..._Attrs>
class VertexBuffer
{
    static constexpr const bool ownIndices = sizeof...(_Attrs) == 0;

    void test(){
        static_asssert(ownIndices, "Link to owned indices!!");        
    }
}


int main(){}

error: there are no arguments to 'static_asssert' that depend on a template
parameter, so a declaration of 'static_asssert' must be available
[-fpermissive]
         static_asssert(ownIndices, "Link to owned indices!!");
                                                             ^

Doesn't ownIndices template-dependent value?

Compiled with MinGW 4.9


More information about the Gcc-bugs mailing list