Skip to content

Function parameter 'map' with unknown value cannot be used in a constant expression #60548

@4465464

Description

@4465464
#include <iostream>

namespace cuco{

    template<typename Key,typename Value>
    class static_multimap{
        public:
            static_multimap(std::size_t capacity);
            static constexpr uint32_t cg_size() noexpect{
                return 100;
            }
    };

    template<typename Key,typename Value>
    static_multimap<Key,Value>::static_multimap(std::size_t capicity){

    }

    template <typename Map>
    void test_non_shmem_pair_retrieve(Map& map){
        auto constexpr cg_size =map.cg_size();
    } 

    template<typename Key,typename Value>
    void test_cuco(){
        cuco::static_multimap<Key,Value>map{100};
        auto constexpr cg_size=map.cg_size();             //case1
        test_non_shmem_pair_retrieve(map);                //case2
    }
}

int main(){
    cuco::test_cuco<int64_t,int64_t>();
}

Metadata

Metadata

Assignees

Labels

c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyduplicateResolved as duplicate

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions