Skip to content

Latest commit

 

History

History
50 lines (42 loc) · 1.09 KB

compiler-warning-level-4-c4673.md

File metadata and controls

50 lines (42 loc) · 1.09 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Warning (level 4) C4673
Compiler Warning (level 4) C4673
11/04/2016
C4673
C4673
95626ec6-f05b-43c7-8b9a-a60a6f98dd30

Compiler Warning (level 4) C4673

throwing 'identifier' the following types will not be considered at the catch site

A throw object cannot be handled in the catch block. Each type that cannot be handled is listed in the error output immediately following the line containing this warning. Each unhandled type has its own warning. Read the warning for each specific type for more information.

The following sample generates C4673:

// C4673.cpp
// compile with: /EHsc /W4
class Base {
private:
   char * m_chr;
public:
   Base() {
      m_chr = 0;
   }

   ~Base() {
      if(m_chr)
         delete m_chr;
   }
};

class Derv : private Base {
public:
   Derv() {}
   ~Derv() {}
};

int main() {
   try {
      Derv D1;
      // delete previous line, uncomment the next line to resolve
      // Base D1;
      throw D1;   // C4673
   }

   catch(...) {}
}