Differences with C++

Instead of chasing down dependencies, made some fake ones.

struct Adafruit_I2CDevice {};
struct TwoWire {} Wire;
struct DateTime {};
struct Ds1307SqwPinMode {};

class RTC_I2C {
protected:
  /*!
      @brief  Convert a binary coded decimal value to binary. RTC stores
    time/date values as BCD.
      @param val BCD value
      @return Binary value
  */
  static uint8_t bcd2bin(uint8_t val) { return val - 6 * (val >> 4); }
  /*!
      @brief  Convert a binary value to BCD format for the RTC registers
      @param val Binary value
      @return BCD value
  */
  static uint8_t bin2bcd(uint8_t val) { return val + 6 * (val / 10); }
  Adafruit_I2CDevice *i2c_dev = NULL; ///< Pointer to I2C bus interface
  uint8_t read_register(uint8_t reg);
  void write_register(uint8_t reg, uint8_t val);
};

/**************************************************************************/
/*!
    @brief  RTC based on the DS1307 chip connected via I2C and the Wire library
*/
/**************************************************************************/
class RTC_DS1307 : public RTC_I2C {
public:
  bool begin(TwoWire *wireInstance = &Wire);
  void adjust(const DateTime &dt);
  uint8_t isrunning(void);
  DateTime now();
  Ds1307SqwPinMode readSqwPinMode();
  void writeSqwPinMode(Ds1307SqwPinMode mode);
  uint8_t readnvram(uint8_t address);
  void readnvram(uint8_t *buf, uint8_t size, uint8_t address);
  void writenvram(uint8_t address, uint8_t data);
  void writenvram(uint8_t address, const uint8_t *buf, uint8_t size);
};

void setup() {}

void loop() {}

Added setup and loop as usual at the bottom. Compiles without complaint.

In the Settings, turn on "Show verbose output during compile"

Compiling sketch...
/Users/kenb4/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -Wall -Wextra -std=gnu++11 ...

Scroll to the right and it says -std=gnu++11, as mentioned

A little "magic" is applied to an .ino file to convert it to the .ino.cpp that is compiled. There's a hidden #include <Arduino.h> inserted at the top of the file, which adds a bunch of stuff. Forward declarations are inserted so that the order of functions does not matter. As mentioned, some standard libraries are omitted on AVR. But it's not changing the language grammar.

The next step is to show all the errors. If you're familiar with C++, you know how problems can cascade. Please post them as code as well. If there's just that one error about "public" and you don't want to post all your code: after you verify that what I posted also works for you, work your way to the middle to see what triggers the problem.

2 Likes