Skip to content

bool bitfield += complex gets infinite loop #163140

@tydeman

Description

@tydeman

The following code gets an infinity loop at runtime.

#include <assert.h>	/* assert */
#include <stddef.h>	/* offsetof */
#include <float.h>	/* FLT_SNAN */
#include <complex.h>	/* FLT_CMPLX */
#include <wchar.h>	/* wchar_t */
#include <stdio.h>	/* printf */
int main(void){
  if(1){
    struct bit2 {
      unsigned int uibf : 7;
        signed int sibf : 7;
              bool bobf : 1;
    } bits = { 1u, 1, 1 };
    struct bit2 res;
    res.bobf = bits.bobf += CMPLXF( 1.5f, 1.5f );
  }
  return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"floating-pointFloating-point math

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions