hcc icon indicating copy to clipboard operation
hcc copied to clipboard

unexpected assertion when compiling an almost empty file

Open ssahasra opened this issue 7 years ago • 0 comments

When using a debug build of hcc, an attempt to compile the attached file produces an assertion. hc_ring.txt

Note that the file just contains two #include statements, which must be present in the same sequence as shown.

$ cat hc_ring.cpp
#include "foo.h"
#include <hc.hpp>

The first statement results in a fatal error, but then later clang asserts on something inside the second include:

~/builds/hcc/bin/hcc -hc -std=c++amp -I/home/ssahasra/projects/hcc/include -c hc_ring.cpp
hc_ring.cpp:1:10: fatal error: 'foo.h' file not found
#include "foo.h"
         ^~~~~~~
1 error generated.
hc_ring.cpp:1:10: fatal error: 'foo.h' file not found
#include "foo.h"
         ^~~~~~~
clang-7: /home/ssahasra/projects/hcc/clang/lib/Sema/SemaOverload.cpp:9729: {anonymous}::ClassifyOverloadCandidate(clang::Sema&, clang::NamedDecl*, clang::FunctionDecl*, std::__cxx11::string
&)::<lambda()>: Assertion `Ctor->isCopyConstructor() && "unexpected sort of implicit constructor"' failed.
Stack dump:
0.      Program arguments: <snipped>
1.      /home/ssahasra/builds/hcc/bin/../include/hc.hpp:7759:61: current parser token ';'
2.      /home/ssahasra/builds/hcc/bin/../include/hc.hpp:46:1: parsing namespace 'hc'
3.      /home/ssahasra/builds/hcc/bin/../include/hc.hpp:7736:104: parsing function body 'hc::parallel_for_each'
4.      /home/ssahasra/builds/hcc/bin/../include/hc.hpp:7736:104: in compound statement ('{}')

ssahasra avatar Jul 26 '18 10:07 ssahasra