https://bugs.llvm.org/show_bug.cgi?id=47234

            Bug ID: 47234
           Summary: clang cannot initialize a variable of type 'double
                    (*)[a][b]' with an rvalue of type 'double (*)[a][b]'
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

Clang++ rejects the following code while g++ accepts.

$ cat s.C

#include<stdio.h>
#include<stdlib.h>

int a,b;

void f(double *x1)
{
  double (*x2)[a][b]=(double(*)[a][b])x1;
}

int main()
{ double *data;
  a=100;
  b=100;
  data=(double*)malloc(a*b*sizeof(double));
  f(data,0);
  return 0;
}

$ clang++ -c s.C
s.C:8:12: error: cannot initialize a variable of type 'double (*)[a][b]' with
an rvalue of type 'double (*)[a][b]'
  double (*x2)[a][b]=(double(*)[a][b])x1;
           ^         ~~~~~~~~~~~~~~~~~~~
1 error generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to