Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 747 Bytes

compiler-error-c2381.md

File metadata and controls

23 lines (19 loc) · 747 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C2381
Compiler Error C2381
11/04/2016
C2381
C2381
cc765f67-64ac-406f-93ef-ae7d548d58d7

Compiler Error C2381

'function' : redefinition; __declspec(noreturn) differs

A function was declared and then defined but the definition used the noreturn __declspec modifier. The use of noreturn constitutes a redefinition of the function; the declaration and definition need to agree on the use of noreturn.

The following sample generates C2381:

// C2381.cpp
// compile with: /c
void f1();
void __declspec(noreturn) f1() {}   // C2381
void __declspec(noreturn) f2() {}   // OK