https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117308
Bug ID: 117308
Summary: Undocumented implementation limits of C++
specification (ISO/IEC 14882)
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: Thomas.Kiess at vector dot com
Target Milestone: ---
Hi,
the current implementation limits overview
(https://gcc.gnu.org/onlinedocs/gcc-14.2.0/cpp/Implementation-limits.html) does
not list all "Implementation quantities" [implimits] of a recent C++
specification (e.g., ISO/IEC 14882:2014 or 2017, ...).
The C++14 specification lists the following implementation quantities:
— Nesting levels of compound statements, iteration control structures, and
selection control structures
[256].
— Nesting levels of conditional inclusion [256].
— Pointer, array, and function declarators (in any combination) modifying a
class, arithmetic, or incom-
plete type in a declaration [256].
— Nesting levels of parenthesized expressions within a full-expression [256].
— Number of characters in an internal identifier or macro name [1 024].
— Number of characters in an external identifier [1 024].
— External identifiers in one translation unit [65 536].
— Identifiers with block scope declared in one block [1 024].
— Macro identifiers simultaneously defined in one translation unit [65 536].
— Parameters in one function definition [256].
— Arguments in one function call [256].
— Parameters in one macro definition [256].
— Arguments in one macro invocation [256].
— Characters in one logical source line [65 536].
— Characters in a string literal (after concatenation) [65 536].
— Size of an object [262 144].
— Nesting levels for #include files [256].
— Case labels for a switch statement (excluding those for any nested switch
statements) [16 384].
— Data members in a single class [16 384].
— Enumeration constants in a single enumeration [4 096].
— Levels of nested class definitions in a single member-specification [256].
https://gcc.gnu.org/onlinedocs/gcc-14.2.0/cpp/Implementation-limits.html only
lists
- Nesting levels of ‘#include’ files.
- Nesting levels of conditional inclusion.
- Levels of parenthesized expressions within a full expression.
- Significant initial characters in an identifier or macro name.
- Number of macros simultaneously defined in a single translation unit.
- Number of parameters in a macro definition and arguments in a macro call.
- Number of characters on a logical source line.
- Maximum size of a source file.
I create this bug ticket, because it is requested by
https://gcc.gnu.org/onlinedocs/gcc-14.2.0/cpp/Implementation-limits.html: "If
you encounter an undocumented or inconvenient limit, please report that as a
bug. See Reporting Bugs in Using the GNU Compiler Collection (GCC)."
I/we are primarily interested in the effect of violating
— External identifiers in one translation unit [65 536].
— Size of an object [262 144].
— Data members in a single class [16 384].
What happens when the limit of the standard is violated, what is the limit of
GCC and what happens when the GCC/g++ limit is violated (more items/objects are
"used").
Best regards,
Thomas