<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - clang crashes on valid C++ code: Assertion `T->isIntegralType(Context) && "Integral type required!"' failed"
   href="https://bugs.llvm.org/show_bug.cgi?id=35586">35586</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang crashes on valid C++ code: Assertion `T->isIntegralType(Context) && "Integral type required!"' failed
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>su@cs.ucdavis.edu
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Tested with trunk revision 320252. 

$ clangpolly++ -v
clang version 6.0.0 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a>
466d8da5f89b1a780f735c86f414fa69ce63221b) (<a href="http://llvm.org/git/llvm.git">http://llvm.org/git/llvm.git</a>
b45da9e64a53ccc1b9707c7e56448dea9adf10fc)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

$ clang++-4.0.0 -c tmp.cpp
$ g++-7.2.0 -c tmp.cpp
$ icc -c tmp.cpp

$ clangpolly++ -c tmp.cpp
clang-6.0:
/home/su/software/tmp/polly/llvm/tools/clang/lib/Sema/SemaDecl.cpp:15236:
clang::QualType getNextLargerIntegralType(clang::ASTContext&, clang::QualType):
Assertion `T->isIntegralType(Context) && "Integral type required!"' failed.
#0 0x000000000211dfba llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:402:0
#1 0x000000000211be4e llvm::sys::RunSignalHandlers()
/home/su/software/tmp/polly/llvm/lib/Support/Signals.cpp:50:0
#2 0x000000000211bfc2 SignalHandler(int)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:242:0
#3 0x00007f2898bdb390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007f289794d428 gsignal
/build/glibc-bfm8X4/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007f289794f02a abort /build/glibc-bfm8X4/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007f2897945bd7 __assert_fail_base
/build/glibc-bfm8X4/glibc-2.23/assert/assert.c:92:0
#7 0x00007f2897945c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x0000000002f4a35a llvm::APSInt::operator<(llvm::APSInt const&) const
/home/su/software/tmp/polly/llvm/include/llvm/ADT/APSInt.h:136:0
#9 0x0000000002f4a35a clang::Sema::CheckEnumConstant(clang::EnumDecl*,
clang::EnumConstantDecl*, clang::SourceLocation, clang::IdentifierInfo*,
clang::Expr*)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Sema/SemaDecl.cpp:15364:0
#10 0x0000000002f4c333 clang::Sema::ActOnEnumConstant(clang::Scope*,
clang::Decl*, clang::Decl*, clang::SourceLocation, clang::IdentifierInfo*,
clang::AttributeList*, clang::SourceLocation, clang::Expr*)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Sema/SemaDecl.cpp:15489:0
#11 0x0000000002ce6917 clang::Parser::ParseEnumBody(clang::SourceLocation,
clang::Decl*)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Parse/ParseDecl.cpp:4436:0
#12 0x0000000002ce827c clang::Parser::ParseEnumSpecifier(clang::SourceLocation,
clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&,
clang::AccessSpecifier, clang::Parser::DeclSpecContext)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Parse/ParseDecl.cpp:4357:0
#13 0x0000000002ceb2b6
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Parse/ParseDecl.cpp:3631:0
#14 0x0000000002cced86
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Parse/Parser.cpp:926:0
#15 0x0000000002ccf541
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) [clone .part.161] [clone
.constprop.184]
/home/su/software/tmp/polly/llvm/tools/clang/lib/Parse/Parser.cpp:1003:0
#16 0x0000000002ccf59f
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Parse/Parser.cpp:1005:0
#17 0x0000000002cd407d
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Parse/Parser.cpp:853:0
#18 0x0000000002cd508c clang::AttributePool::~AttributePool()
/home/su/software/tmp/polly/llvm/tools/clang/include/clang/Sema/AttributeList.h:643:0
#19 0x0000000002cd508c clang::ParsedAttributes::~ParsedAttributes()
/home/su/software/tmp/polly/llvm/tools/clang/include/clang/Sema/AttributeList.h:734:0
#20 0x0000000002cd508c
clang::Parser::ParsedAttributesWithRange::~ParsedAttributesWithRange()
/home/su/software/tmp/polly/llvm/tools/clang/include/clang/Parse/Parser.h:1304:0
#21 0x0000000002cd508c
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Parse/Parser.cpp:606:0
#22 0x0000000002ccad6b clang::ParseAST(clang::Sema&, bool, bool)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Parse/ParseAST.cpp:146:0
#23 0x0000000002af668f clang::CodeGenAction::ExecuteAction()
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1032:0
#24 0x00000000026865a6 clang::FrontendAction::Execute()
/home/su/software/tmp/polly/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:897:0
#25 0x00000000026566d6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:992:0
#26 0x0000000002715502
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/su/software/tmp/polly/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#27 0x0000000000aa13b8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#28 0x0000000000a19152 ExecuteCC1Tool
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/driver.cpp:309:0
#29 0x0000000000a19152 main
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/driver.cpp:388:0
#30 0x00007f2897938830 __libc_start_main
/build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:325:0
#31 0x0000000000a9dcd9 _start
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0xa9dcd9)
Stack dump:
0.      Program arguments: /home/su/software/tmp/polly/llvm_build/bin/clang-6.0
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name tmp.cpp -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -coverage-notes-file
/home/su/projects/c-hunter-latest/test/icc-cpp/RES8/20171207-clangpolly++-O3-m64-build-063032/tmp.gcno
-resource-dir /home/su/software/tmp/polly/llvm_build/lib/clang/6.0.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/backward
-internal-isystem /usr/local/include -internal-isystem
/home/su/software/tmp/polly/llvm_build/lib/clang/6.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir
/home/su/projects/c-hunter-latest/test/icc-cpp/RES8/20171207-clangpolly++-O3-m64-build-063032
-ferror-limit 19 -fmessage-length 116 -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o tmp.o -x c++
tmp.cpp 
1.      tmp.cpp:2:28: current parser token '}'
clang-6.0: error: unable to execute command: Aborted (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a>
466d8da5f89b1a780f735c86f414fa69ce63221b) (<a href="http://llvm.org/git/llvm.git">http://llvm.org/git/llvm.git</a>
b45da9e64a53ccc1b9707c7e56448dea9adf10fc)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-6.0: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-6.0: note: diagnostic msg: /tmp/tmp-ac2b61.cpp
clang-6.0: note: diagnostic msg: /tmp/tmp-ac2b61.sh
clang-6.0: note: diagnostic msg: 

********************


--------------------------------

enum C { R, G, B };
enum B { F = (enum C) -1, T};</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>