W8052 Base initialization without a class name is now obsolete (C++)

From RAD Studio
Jump to: navigation, search

Go Up to Compiler Errors And Warnings (C++) Index

(Command-line option to suppress warning: -w-obi)

Early versions of C++ provided for initialization of a base class by following the constructor header with just the base class constructor parameter list.

It is now recommended to include the base class name.

This makes the code much clearer, and is required when you have multiple base classes.

Old way

derived::derived(int i) : (i, 10) { ... }

New way

derived::derived(int i) : base(i, 10) { ... }