https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97525

            Bug ID: 97525
           Summary: failed to report use before initialization in
                    constructor initialization
           Product: gcc
           Version: og10 (devel/omp/gcc-10)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: smuccione at agisent dot com
  Target Milestone: ---

https://godbolt.org/z/v63vx3

notice the missing parameter in the constructor.

class t
{
int x;
public:
    t ( int  ) : x ( x )
    {
    }
};
int main()
{
    t a ( 1 );
}
CLANG properly warns of a use before initialization. MSVC and GCC do not.
  • [Bug c++/97525] New: failed to r... smuccione at agisent dot com via Gcc-bugs

Reply via email to