msvc: `BOOST_PP_VARIADIC_SIZE` broken for size larger than 64

Open
#42 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
cpp
Domain
compilers

Research direction

Start with boost/preprocessor/variadic/size.hpp and reproduce the supplied 65-argument example with MSVC. Trace how BOOST_PP_VARIADIC_SIZE handles argument counts above 64, then verify that the example compiles and its static_assert reports 65.

Written by the indexing model from the issue text.

Description

#define BOOST_PP_LIMIT_VARIADIC 256

#include <boost/preprocessor/variadic/size.hpp>

#include <cstddef>

#define VAR_DATA a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, b, b, b, b, b

constexpr size_t sz = BOOST_PP_VARIADIC_SIZE(VAR_DATA);

static_assert(sz == 65);

gives:


<source>(9): error C2065: 'b': undeclared identifier
<source>(9): error C2131: expression did not evaluate to a constant
<source>(9): note: a non-constant (sub-)expression was encountered
<source>(11): error C2131: expression did not evaluate to a constant
<source>(9): note: a non-constant (sub-)expression was encountered

compare: https://godbolt.org/z/bfoETMnad

Dominant language
C++
Stars
118
Forks
76
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/preprocessor

All issues in boostorg/preprocessor

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.