A mechanized semantics for C++ object construction and destruction, with applications to resource management

  • Authors:
  • Tahina Ramananandro;Gabriel Dos Reis;Xavier Leroy

  • Affiliations:
  • INRIA Paris-Rocquencourt, Le Chesnay, France;Texas A&M University, College Station, TX, USA;INRIA Paris-Rocquencourt, Le Chesnay, France

  • Venue:
  • POPL '12 Proceedings of the 39th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
  • Year:
  • 2012
  • Foundations of c++

    ESOP'12 Proceedings of the 21st European conference on Programming Languages and Systems

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present a formal operational semantics and its Coq mechanization for the C++ object model, featuring object construction and destruction, shared and repeated multiple inheritance, and virtual function call dispatch. These are key C++ language features for high-level system programming, in particular for predictable and reliable resource management. This paper is the first to present a formal mechanized account of the metatheory of construction and destruction in C++, and applications to popular programming techniques such as "resource acquisition is initialization". We also report on irregularities and apparent contradictions in the ISO C++03 and C++11 standards.