<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - Crash in typo correct with bad type suggestion."
href="https://llvm.org/bugs/show_bug.cgi?id=24781">24781</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crash in typo correct with bad type suggestion.
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rtrieu@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, rikka@google.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>repro.cpp:
namespace A {
namespace B {
class Foo {};
} // namespace B
} // namespace A
namespace C {
namespace D {
//Uncomment using statement to prevent crash.
//using A::B::Foo;
class Bar : public A::B::Foo {};
} // namespace D
} // namespace C
using C::D::Foo;
Command:
clang repro.cpp
Output:
repro.cpp:20:7: error: no member named 'Foo' in namespace 'C::D'; did you mean
'C::D::Bar::Foo'?
using C::D::Foo;
^~~~~~~~~
C::D::Bar::Foo
repro.cpp:4:7: note: 'C::D::Bar::Foo' declared here
class Foo {};
^
clang-3.5: ../include/llvm/Support/Casting.h:237: typename cast_retty<X, Y
*>::ret_type llvm::cast(Y *) [X = clang::CXXRecordDecl, Y =
clang::DeclContext]: Assertion `isa<X>(Val) && "cast<Ty>() argument of
incompatible type!"' failed.
#0 0x16cb20d llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/bin/clang-3.5+0x16cb20d)
#1 0x16ca8a6 llvm::sys::RunSignalHandlers()
(/usr/local/bin/clang-3.5+0x16ca8a6)
#2 0x16cc6aa SignalHandler(int) (/usr/local/bin/clang-3.5+0x16cc6aa)
#3 0x7f977e187340 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)
#4 0x7f977d6b3cc9 gsignal
/build/buildd/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x7f977d6b70d8 abort /build/buildd/eglibc-2.19/stdlib/abort.c:91:0
#6 0x7f977d6acb86 __assert_fail_base
/build/buildd/eglibc-2.19/assert/assert.c:92:0
#7 0x7f977d6acc32 (/lib/x86_64-linux-gnu/libc.so.6+0x2fc32)
#8 0x23c5c20
clang::Sema::CheckInheritingConstructorUsingDecl(clang::UsingDecl*)
(/usr/local/bin/clang-3.5+0x23c5c20)
#9 0x23c2c0b clang::Sema::BuildUsingDeclaration(clang::Scope*,
clang::AccessSpecifier, clang::SourceLocation, clang::CXXScopeSpec&,
clang::DeclarationNameInfo, clang::AttributeList*, bool, bool,
clang::SourceLocation) (/usr/local/bin/clang-3.5+0x23c2c0b)
#10 0x23c1856 clang::Sema::ActOnUsingDeclaration(clang::Scope*,
clang::AccessSpecifier, bool, clang::SourceLocation, clang::CXXScopeSpec&,
clang::UnqualifiedId&, clang::AttributeList*, bool, clang::SourceLocation)
(/usr/local/bin/clang-3.5+0x23c1856)
The suggestion is wrong since a base class cannot be used in using statement.</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>