https://bugs.llvm.org/show_bug.cgi?id=37828
Bug ID: 37828
Summary: clang++ fails to allocate a "float (*)[height]" to
"float (*)[height]" object
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: cs15btech11...@iith.ac.in
CC: llvm-bugs@lists.llvm.org
Clang++ (version 7.0.0 (trunk 334413)) fails to compile the following code
#include <stdlib.h>
void allocateArray(int height) {
float (* Ix)[height];
Ix = (float(*) [height]) malloc(sizeof(float)* (height));
}
Error:
clangBugCheck.cpp:4:7: error: assigning to 'float (*)[height]' from
incompatible type 'float (*)[height]'
Ix = (float(*) [height]) malloc(sizeof(float)* (height));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Command used to compile code: clang++ filename.cpp -c
GCC and ICC are able to compile the code.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs