<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 -O0: "cast<Ty>() argument of incompatible type""
   href="https://bugs.llvm.org/show_bug.cgi?id=35761">35761</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang -O0: "cast<Ty>() argument of incompatible type"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>babokin@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>clang x86_84, trunk rev 321482.

<span class="quote">> cat f.c</span >
namespace a {
typedef int b;
struct c {
  template <typename d, typename e> struct f {
    using g = typename d::template h<e>::i;
  };
};
template <typename j, typename e> using k = typename c::f<j, e>::g;
template <typename j> struct l {
  typedef typename j::m m;
  template <typename d> using n = k<j, d>;
};
}
namespace aa {
template <typename j> struct o {
  typedef a::l<j> p;
  typedef typename p::m q;
  template <typename d> struct h { typedef typename p::template n<d> i; };
};
}
namespace a {
template <class d> class r {
public:
  d &operator[](b);
};
}
namespace aa {
template <typename d> class s {
public:
  typedef d m;
  template <typename> struct h { typedef s i; };
};
}
namespace a {
template <typename d> using t = aa::s<d>;
template <typename d> class ab : public t<d> {};
template <typename d, typename j> struct ac {
  typedef typename aa::o<j>::template h<d>::i ad;
};
template <typename d, typename j = ab<d>> class u {
  typedef ac<d, j> ae;
  typedef typename ae::ad ad;
  typedef aa::o<ad> v;
  typedef typename v::q q;
  typedef b w;

public:
  q af(w);
};
}
bool x;
int y;
struct z {
  char ag : 22;
  bool : 8;
};
struct ah {
  z ai;
};
a::u<int> aj;
a::r<ah> ak;
void al() { ak[2].ai.ag = x | ~~(32767 | aj.af(3)) ^ y; }

<span class="quote">> clang++  -std=c++11 -w -O0 -c f.c</span >
clang-6.0:
/localdisk2/users/dybaboki/llvm/llvm-trunk-20171227/include/llvm/Support/Casting.h:241:
typename std::enable_if<!is_simple_type<Y>::value, typename cast_retty<X, const
Y>::ret_type>::type llvm::cast(const Y &) [X = llvm::ConstantSDNode, Y =
llvm::SDValue]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible
type!"' failed.
#0 0x00000000013dfcbf llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x13dfcbf)
#1 0x00000000013dffc6 SignalHandler(int)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x13dffc6)
#2 0x00007f3a3134c5e0 __restore_rt (/lib64/libpthread.so.0+0xf5e0)
#3 0x00007f3a2fec51f7 __GI_raise (/lib64/libc.so.6+0x351f7)
#4 0x00007f3a2fec68e8 __GI_abort (/lib64/libc.so.6+0x368e8)
#5 0x00007f3a2febe266 __assert_fail_base (/lib64/libc.so.6+0x2e266)
#6 0x00007f3a2febe312 (/lib64/libc.so.6+0x2e312)
#7 0x0000000001a846dd (anonymous
namespace)::DAGCombiner::visitAND(llvm::SDNode*)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x1a846dd)
#8 0x0000000001a57e45 (anonymous namespace)::DAGCombiner::visit(llvm::SDNode*)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x1a57e45)
#9 0x0000000001a5557c (anonymous
namespace)::DAGCombiner::combine(llvm::SDNode*)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x1a5557c)
#10 0x0000000001a541ff llvm::SelectionDAG::Combine(llvm::CombineLevel,
llvm::AAResults*, llvm::CodeGenOpt::Level)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x1a541ff)
#11 0x0000000001b9210f llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x1b9210f)
#12 0x0000000001b901be
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x1b901be)
#13 0x0000000001b8ca82
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x1b8ca82)
#14 0x0000000000851351 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x851351)
#15 0x0000000000c2153e
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0xc2153e)
#16 0x0000000000f4775f llvm::FPPassManager::runOnFunction(llvm::Function&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0xf4775f)
#17 0x0000000000f47a23 llvm::FPPassManager::runOnModule(llvm::Module&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0xf47a23)
#18 0x0000000000f47f09 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0xf47f09)
#19 0x000000000157505f clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x157505f)
#20 0x0000000001c80ab6
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x1c80ab6)
#21 0x0000000002137a36 clang::ParseAST(clang::Sema&, bool, bool)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x2137a36)
#22 0x0000000001939eb8 clang::FrontendAction::Execute()
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x1939eb8)
#23 0x00000000018fbe81
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x18fbe81)
#24 0x00000000019c4a68
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x19c4a68)
#25 0x00000000007a4daa cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x7a4daa)
#26 0x00000000007a30c9 main
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x7a30c9)
#27 0x00007f3a2feb1c05 __libc_start_main (/lib64/libc.so.6+0x21c05)
#28 0x00000000007a04f2 _start
(/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0+0x7a04f2)
Stack dump:
0.      Program arguments:
/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/bin/clang-6.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
f.c -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
/users/dybaboki/yarpgen/yarpgen/test_run_dec19_reduce/result/clang/compfail/S_12_2880678421/f.gcno
-resource-dir
/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/lib/clang/6.0.0
-internal-isystem
/users/dybaboki/gcc/bin/lib/gcc/x86_64-pc-linux-gnu/8.0.0/../../../../include/c++/8.0.0
-internal-isystem
/users/dybaboki/gcc/bin/lib/gcc/x86_64-pc-linux-gnu/8.0.0/../../../../include/c++/8.0.0/x86_64-pc-linux-gnu
-internal-isystem
/users/dybaboki/gcc/bin/lib/gcc/x86_64-pc-linux-gnu/8.0.0/../../../../include/c++/8.0.0/backward
-internal-isystem /usr/local/include -internal-isystem
/localdisk2/users/dybaboki/llvm/bin-trunk-20171227/lib/clang/6.0.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O0
-w -std=c++11 -fdeprecated-macro -fdebug-compilation-dir
/users/dybaboki/yarpgen/yarpgen/test_run_dec19_reduce/result/clang/compfail/S_12_2880678421
-ferror-limit 19 -fmessage-length 204 -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o f.o -x c++ f.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'f.c'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@_Z2alv'
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 (trunk 321482)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /users/dybaboki/llvm/bin-trunk-20171227/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: Error generating preprocessed source(s).</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>