cpp-docs icon indicating copy to clipboard operation
cpp-docs copied to clipboard

Improve C3083 error reference

Open Rageking8 opened this issue 4 months ago • 4 comments

  • Update outdated error message and add blockquotes
  • Add "Remarks" heading and overhaul its content since "A function was called incorrectly." is too vague
  • Fix example as the old one no longer emits C3083
  • Update metadata

Other examples

// C3083.cpp

namespace A
{
    void func() {}
}

int main()
{
    A::A::func();   // C3083
}
C:\Test>cl C3083.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35214 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

C3083.cpp
C3083.cpp(10): error C2039: 'A': is not a member of 'A'
C3083.cpp(3): note: see declaration of 'A'
C3083.cpp(10): error C3083: 'A': the symbol to the left of a '::' must be a type

Another one about missing includes:

// C3083.cpp

// #include <chrono>

int main()
{
    auto n = std::chrono::system_clock::now();   // C3083 and many others
}
C:\Test>cl C3083.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35214 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

C3083.cpp
C3083.cpp(7): error C2039: 'chrono': is not a member of 'std'
predefined C++ types (compiler internal)(357): note: see declaration of 'std'
C3083.cpp(7): error C2039: 'system_clock': is not a member of 'std'
predefined C++ types (compiler internal)(357): note: see declaration of 'std'
C3083.cpp(7): error C3083: 'chrono': the symbol to the left of a '::' must be a type
C3083.cpp(7): error C3083: 'system_clock': the symbol to the left of a '::' must be a type
C3083.cpp(7): error C2039: 'now': is not a member of 'std'
predefined C++ types (compiler internal)(357): note: see declaration of 'std'
C3083.cpp(7): error C3861: 'now': identifier not found

Rageking8 avatar Aug 14 '25 13:08 Rageking8