Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Recommended

We'll recommend resources you may like as you browse. Try these suggestions for now.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

Report from the February 2020 ISO C++ meeting (Core Language Working Group)

April 23, 2020
Jason Merrill
Related topics:
LinuxOpen source
Related products:
Red Hat OpenShift

    The first International Organization for Standardization (ISO) C++ meeting of 2020 happened in Prague, Czechia. It was our first time meeting in Prague, though I've been there a few times for the GNU Tools Cauldron. Two of us from Red Hat attended: Jonathan Wakely serves on the ISO C++ Standards Committee Library Working Group (LWG), and I am part of the Core Language Working Group (CWG). (You can see the ISO C++ committee structure here.)

    This was our second meeting after sending the C++20 draft standard out for comments from the ISO C++ national bodies. We finished responses to the last round of comments. That went well, and at the end of the week, we voted to send the resulting C++20 standard to the national bodies for ratification.

    In the next sections, I'll share the thinking behind some of our decisions. Note that this report addresses mostly lower-level issues, unlike my usual trip reports.

    Concepts

    As part of my work on concepts, I contributed wording to the resolution of two closely connected issues.

    Clarify declaration matching

    The first issue is documented in CA104 13.04 [temp.constr]: Clarify declaration matching and partial ordering requiring substitution into constraints. Normally, we try to avoid substituting directly into constraints as written in a requires-clause. Instead, we prefer substitution only on atomic constraints as part of determining whether requirements have been satisfied.

    In the case of comparing a declaration at namespace scope to a declaration in an instantiation of a class template, however, we must allow a direct substitution in some instances. One example is determining whether a specialization matches:

    template <class T> struct A {
        template <class U> U f(U) requires C<typename T::type>;
        template <class U> U f(U) requires C<T>;
      };
    
    // Substitute int for T in above requirements to find match.
      template <> template <class U> U A<int>::f(U) requires C<int>  { }
    

    Hidden non-template friends

    The second issue is from US115 13.6.4 [temp.friend]: Hidden non-template friends need a requires-clause. Until now, it was considered ill-formed for a non-template friend declaration to have a requires-clause. The ISO C++ committee reasoned that it would be unclear whether the non-template friend declaration was trying to match a given constrained overload, or if it was trying to declare friendship only if the requirements are satisfied. We determined that removing constraints on non-template functions renders the first concern meaningless. The second concern remains an undesirable difference from constraint semantics in all other situations.

    If the friend is defined in the class body, then having a requires-clause makes just as much sense as it does on a member function. That is, the clause can be used to define a particular operation for a class template, depending on the characteristics of the template arguments. The library was already allowing this behavior even though the language said it was invalid.

    We resolved to allow the requires-clause on a friend that is defined in a templated class. To avoid the kind of substitution needed for partial specialization matching (as shown in the code sample), we said that any friend template with a constraint that depends on a template parameter of the class must also be defined in the class body. If the constraint only depends on the friend's template parameters, it can be a declaration to match with a template defined at namespace scope.

    Changing concept values

    Continuing with concepts, we addressed Disallow changing concept values. This paper resolves GB046 as "accepted with modifications."

    We noticed when working on concepts in the G++ compiler that the draft allowed the satisfaction of a declaration to vary within a translation unit. This meant, for example, that a declaration could be satisfied by a class becoming complete. Supporting this change slows down the compiler because we could no longer remember the results of a previous check across events such as completing a class definition. The decision to disallow changing concept values means that we don't have to worry about that problem, and we can speed up the compiler again. As a caveat, the current resolution breaks a fair amount of concept code, so more investigation is needed.

    Function template constraints

    For the Proposed resolution for 2019 comment CA 112, we resolved to clarify that a function template can only be considered more constrained than another if the template parameters are otherwise equivalent.

    Modules

    We addressed three proposals dealing with the complications of entities that were once local to a translation unit. In a module interface unit, such entities could become visible to importing translation units:

    • P1815R2: Translation-unit-local entities makes it ill-formed for an exported declaration to expose a translation-local entity.
    • P1779R3: ABI isolation for member functions makes functions defined in a class body within a module no longer implicitly inline, so that they can use local entities without exposing them.
    • P2115R0: Merging of multiple definitions for unnamed unscoped enumerations deals with how we merge unnamed file-scope enumerations from header files that might not have the same set of enumerators in different translation units.

    Each of these patterns previously violated the one definition rule (ODR) but worked in practice. Note that a compiler is free to inline a function that is not declared inline, so the P1779 change need not affect performance. On ELF targets such as GNU/Linux, which allow symbols to be overridden by other definitions, the GNU Compiler Collection (GCC) currently does not inline replaceable functions unless the user specifies -fno-semantic-interposition. We could address this issue in the GCC Modules implementation by assuming no interposition for functions defined in a module interface unit.

    Miscellaneous

    We also addressed several miscellaneous papers. One of these, P0593R6: Implicit creation of objects for low-level object manipulation, offers a new model for when objects are considered to have been created in malloced memory or a char buffer. Any objects necessary are considered to have been created implicitly by the malloc or creation of the buffer. The new model should bring more clarity to type-based aliasing rules in C++.

    We also addressed the proposal P1957R2: Converting from T* to bool should be considered narrowing. It was surprising to realize that we had not previously considered a pointer-to-bool conversion to be narrowing; however, experimentation suggests that making that change would result in far more bugs than false positives.

    The resolution to P1937R2: Fixing inconsistencies between constexpr and consteval functions states that a consteval call can no longer be immediately evaluated in an unevaluated context.

    Conclusion

    The next meeting was scheduled for June 2020 in Varna, Bulgaria. It has been postponed indefinitely due to COVID-19.

    Last updated: March 29, 2023

    Recent Posts

    • A day in the life of an NVIDIA H100 on Red Hat OpenShift 5

    • Migrate BuildConfigs to builds for Red Hat OpenShift with one plug-in install

    • Run Red Hat Enterprise Linux CoreOS on NVIDIA BlueField DPUs

    • Agent harness engineering: Separating model capabilities from enforcement

    • What's new for developers in Red Hat Enterprise Linux 10.3 and 9.9

    Red Hat Developers logo

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    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
    © 2026 Red Hat

    Red Hat legal and privacy links

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