Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Report from the virtual ISO C++ meetings in 2020 (core language)

May 7, 2021
Jason Merrill
Related topics:
C, C#, C++LinuxOpen source
Related products:
Developer Tools

Share:

    C++ standardization was dramatically different in 2020 from earlier years. The business of the International Organization for Standardization (ISO) committee all took place virtually, much like everything else during this pandemic. This article summarizes the C++ standardization proposals before the Core and Evolution Working Groups last year.

    Core language

    The C++ Core Working Group (CWG) had already been holding monthly Zoom teleconferences between meetings; this was how I encountered Zoom in the before times. So the transition for us was fairly smooth.

    We did end up moving a few papers at a virtual full committee plenary on one of the days of the canceled November meeting.

    Literal suffix for (signed) size_t

    This paper (P0330) was ready after the Belfast meeting in November 2019, but because it was intended as a C++23 feature, we didn't want to bring it up for a vote until after we finished C++20. This proposal makes it easier to write a constant of size_t or ptrdiff_t type. This practice is useful, for instance, to match the return type of a size() function:

    auto m = std::max (0, v.size()); // error, deduction mismatch int vs. size_t
    auto m = std::max (0uz, v.size()); // OK, both arguments are size_t

    Earlier versions of this proposal used t for ptrdiff_t and z for size_t, like the printf conversion specifiers, but the final version uses uz for size_t and z for the corresponding signed type (usually the same as ptrdiff_t).

    Numeric and universal character escapes in character and string literals

    This paper (P2029) clarifies the handling of hex and octal character escapes to standardize the GNU Compiler Collection (GCC) behavior rather than the (Microsoft Visual C++) MSVC behavior: Namely, that a single escape code can correspond to a single UTF-8 code unit, not necessarily an entire character.

    constexpr const char8_t c[] = u8"\xc3\x80"; // UTF-8 encoding of U+00C0 {LATIN CAPITAL LETTER A WITH GRAVE}

    Declarations and where to find them

    During the week of the planned June meeting, CWG decided to meet for the full week, two hours a day, to continue reviewing a paper (P1787) we had started to look at in Prague: An ambitious proposal to overhaul the wording for declaration scope and name lookup completely, and thereby fix more than 60 open issues. One week stretched into three before we got through the whole paper.

    This paper's changes should not affect a significant amount of code; many changes are clarifications that bring the wording in line with existing practice. Some are clarifications of corner cases that most code doesn't depend on, such as ambiguous lookup within a conversion-type-id.

    A few changes allow code that was previously ill-formed:

    • conversion-type-id is added to the list of type-only contexts from P0634:
      template <class T> struct A { operator T::type(); }; // OK
    • ::template is also not required in type-only contexts:
      template <class T> auto f(T t) { return static_cast<T::X<int>>(t); } // OK
    • Default template arguments are now complete-class contexts, like default function arguments:
      template <class T> struct A {
        template <int I = sizeof(t)> void g() { } // OK
        T t;
      };

    One change might break a small amount of existing code: Because the lookup for a name after a dot (.) or arrow operator (->) now happens first in the scope of the object, .template is required in dependent.template X<...> even if a definition of X would be found by  an unqualified lookup:

    template <int> struct X { void f(); };
    template <class T> void g(T t) { t.X<2>::f(); } // error, needs .template

    Generalized wording for partial specializations

    This paper (P2096) just cleaned up places in the standard that still referred to partial specializations only for classes, so that these places cover variable partial specializations, as well.

    Down with ()!

    This paper (P1102) has completed its Core review and should be ready for a vote at the next virtual plenary. The paper proposes a change to lambda syntax to avoid requiring () in a mutable lambda:

    [x = 42] () mutable { ++x; }; // () are uselessly required in C++20

    Language evolution

    The C++ Evolution Working Group (EWG) has been meeting regularly to discuss future directions, but as a matter of policy, has not been voting to forward papers to the CWG until a face-to-face meeting takes place.  Recently, they decided on electronic voting, and the following papers were up for EWG voting through February.

    Narrowing contextual conversions to bool

    CWG2039 changed the condition of a static_assert to reject narrowing conversions to bool, for instance, from integers larger than 1. This seems to have been unintended, and most compilers haven't implemented it yet. So this paper (P1401) changes the feature back and makes the same change to the condition of if constexpr:

    static_assert (2, "two"); // OK again

    Make declaration order layout mandated

    This paper (P1847) argues that because no compiler actually reorders data members with different access, we should drop that permission.

    if consteval

    This proposed mechanism (P1938) is much like if (std::is_constant_evaluated()), except that the first block of the if is an immediate function context, allowing calls to consteval functions with arguments that depend on the parameters of the current (constexpr) function.

    C++ identifier syntax using Unicode standard annex 31

    C++ has periodically needed to change its list of Unicode characters that are allowed in identifiers; this paper (P1949) proposes adopting the set specified by the actual Unicode standard, which has stabilized since C++11.

    Freestanding optional operator new

    This paper (P2013) proposes that a freestanding implementation need not provide a definition of the replaceable new operator.

    Allow duplicate attributes

    C++11 attributes disallowed the repetition of the same attribute within a single attribute list, like [[nodiscard, nodiscard]]. C recently removed this restriction, and this paper (P2156) proposes to do the same for C++.

    Attributes on lambda-expressions

    This paper (P2173) proposes allowing attributes to appear in a lambda after the lambda-introducer, such as:

    [] [[nodiscard]] (int x) { return x; }

    Removing garbage collection support

    This paper (P2186) points out that there are no implementations of the C++11 "minimal support for garbage collection," and that several C++ implementations of actual garbage collection don't interact with the C++11 feature, and so proposes removing it.

    Mixed string literal concatenation

    This paper (P2201) proposes changing the concatenation of string literals with different encoding prefixes from conditionally supported to ill-formed.

    Trimming whitespaces before line splicing

    This paper (P2223) proposes ignoring any whitespace after a backslash (\) at the end of a line, except in a raw string.

    Conclusion

    The various working groups continued to meet virtually through the beginning of the year, and had another virtual plenary the week of the originally planned February meeting.  Currently the tentative plan is to continue meeting virtually through the end of 2021 and meet in person again in February 2022.

    For more information on C and C++, please visit Red Hat Developer's topic page.

    Last updated: February 5, 2024

    Recent Posts

    • Cloud bursting with confidential containers on OpenShift

    • Reach native speed with MacOS llama.cpp container inference

    • A deep dive into Apache Kafka's KRaft protocol

    • Staying ahead of artificial intelligence threats

    • Strengthen privacy and security with encrypted DNS in RHEL

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue