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

            Bug ID: 82310
           Summary: Odd regression in g++-6.4.0 with a variable named
                    major
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dflogeras2 at gmail dot com
  Target Milestone: ---

After upgrading to gcc-6.4.0, one of my regression tests fails to compile.  I
boiled it down to the following simple code which fails to compile, claiming
that "major" was not declared in this scope.  If I change that variable name to
something else (maj), it works.



#include <stdexcept>
#include <stdint.h>

int main() {
  const uint32_t minor( 0 );

  {
      uint32_t file_minor = 0;
      if( minor!= file_minor ) throw std::runtime_error( "version error" );
  }

}

Reply via email to