[llvm-bugs] [Bug 35191] New: SemaDeclCXX.cpp: Assertion `IdentLoc.isValid() && "Invalid TargetName location."' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 3 05:55:58 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=35191

            Bug ID: 35191
           Summary: SemaDeclCXX.cpp: Assertion `IdentLoc.isValid() &&
                    "Invalid TargetName location."' failed.
           Product: clang
           Version: trunk
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sergey.nesterov at intel.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

======================test.cpp======================
template<int> struct A {};

template<int N> struct B : A<N>
{
    using A<N>::operator typename A<N>::X;
};

B<0> b;
====================================================

$ clang++ -v
clang version 6.0.0 (trunk 317212)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...


with debug compiler only:

$ clang++ -c -O0 test.cpp
test.cpp:5:41: error: no type named 'X' in 'A<0>'
    using A<N>::operator typename A<N>::X;
                         ~~~~~~~~~~~~~~~^
test.cpp:8:6: note: in instantiation of template class 'B<0>' requested here
B<0> b;
     ^
clang-6.0: .../llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp:9438:
clang::NamedDecl* clang::Sema::BuildUsingDeclaration(clang::Scope*,
clang::AccessSpecifier, clang::SourceLocation, bool, clang::SourceLocation,
clang::CXXScopeSpec&, clang::Declar
ationNameInfo, clang::SourceLocation, clang::AttributeList*, bool): Assertion
`IdentLoc.isValid() && "Invalid TargetName location."' failed.
#0 0x0000000003ff68c5 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
.../llvm/lib/Support/Unix/Signals.inc:398:0
#1 0x0000000003ff6956 PrintStackTraceSignalHandler(void*)
.../llvm/lib/Support/Unix/Signals.inc:462:0
#2 0x0000000003ff4e42 llvm::sys::RunSignalHandlers()
.../llvm/lib/Support/Signals.cpp:49:0
#3 0x0000000003ff625d SignalHandler(int)
.../llvm/lib/Support/Unix/Signals.inc:252:0
#4 0x00007fd3233d25e0 __restore_rt (/lib64/libpthread.so.0+0xf5e0)
#5 0x00007fd321fcf1f7 __GI_raise (/lib64/libc.so.6+0x351f7)
#6 0x00007fd321fd08e8 __GI_abort (/lib64/libc.so.6+0x368e8)
#7 0x00007fd321fc8266 __assert_fail_base (/lib64/libc.so.6+0x2e266)
#8 0x00007fd321fc8312 (/lib64/libc.so.6+0x2e312)
#9 0x00000000060532b2 clang::Sema::BuildUsingDeclaration(clang::Scope*,
clang::AccessSpecifier, clang::SourceLocation, bool, clang::SourceLocation,
clang::CXXScopeSpec&, clang::DeclarationNameInfo, clang::SourceLocation,
clang::AttributeList*, bool)
.../llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp:9445:0
#10 0x000000000663827d clang::Decl*
clang::TemplateDeclInstantiator::instantiateUnresolvedUsingDecl<clang::UnresolvedUsingValueDecl>(clang::UnresolvedUsingValueDecl*,
bool) .../llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:2676:0
#11 0x000000000662b66a
clang::TemplateDeclInstantiator::VisitUnresolvedUsingValueDecl(clang::UnresolvedUsingValueDecl*)
.../llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:2691:0
#12 0x0000000006617a39 clang::declvisitor::Base<clang::declvisitor::make_ptr,
clang::TemplateDeclInstantiator, clang::Decl*>::Visit(clang::Decl*)
.../debug_build/tools/clang/include/clang/AST/DeclNodes.inc:509:0
#13 0x00000000065dc5b0 clang::Sema::InstantiateClass(clang::SourceLocation,
clang::CXXRecordDecl*, clang::CXXRecordDecl*,
clang::MultiLevelTemplateArgumentList const&,
clang::TemplateSpecializationKind, bool)
.../llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp:2076:0
#14 0x00000000065ddf82
clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation,
clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind,
bool) .../llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp:2525:0
#15 0x00000000066a46d0
clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType,
clang::Sema::TypeDiagnoser*) .../llvm/tools/clang/lib/Sema/SemaType.cpp:7587:0
#16 0x00000000066a3aad clang::Sema::RequireCompleteType(clang::SourceLocation,
clang::QualType, clang::Sema::TypeDiagnoser&)
.../llvm/tools/clang/lib/Sema/SemaType.cpp:7359:0
#17 0x00000000066a4a7f clang::Sema::RequireCompleteType(clang::SourceLocation,
clang::QualType, unsigned int)
.../llvm/tools/clang/lib/Sema/SemaType.cpp:7652:0
#18 0x0000000005e9a015 clang::Sema::ActOnUninitializedDecl(clang::Decl*)
.../llvm/tools/clang/lib/Sema/SemaDecl.cpp:10942:0
#19 0x0000000005a4ca76
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
.../llvm/tools/clang/lib/Parse/ParseDecl.cpp:2343:0
#20 0x0000000005a4b3b3 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
.../llvm/tools/clang/lib/Parse/ParseDecl.cpp:2014:0
#21 0x0000000005a2d672
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
.../llvm/tools/clang/lib/Parse/Parser.cpp:986:0
#22 0x0000000005a2d72a
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
.../llvm/tools/clang/lib/Parse/Parser.cpp:1001:0
#23 0x0000000005a2cdad
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) .../llvm/tools/clang/lib/Parse/Parser.cpp:851:0
#24 0x0000000005a2bfd8
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
.../llvm/tools/clang/lib/Parse/Parser.cpp:613:0
#25 0x0000000005a28003 clang::ParseAST(clang::Sema&, bool, bool)
.../llvm/tools/clang/lib/Parse/ParseAST.cpp:146:0
#26 0x00000000048c21fe clang::ASTFrontendAction::ExecuteAction()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:1000:0
#27 0x0000000004d9e228 clang::CodeGenAction::ExecuteAction()
.../llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1032:0
#28 0x00000000048c1c3f clang::FrontendAction::Execute()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:901:0
#29 0x0000000004863cf6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
.../llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:992:0
#30 0x00000000049f8f20
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
.../llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#31 0x000000000203c49d cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) .../llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#32 0x00000000020321c4 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) .../llvm/tools/clang/tools/driver/driver.cpp:309:0
#33 0x0000000002032e4d main .../llvm/tools/clang/tools/driver/driver.cpp:388:0
#34 0x00007fd321fbbc05 __libc_start_main (/lib64/libc.so.6+0x21c05)
#35 0x000000000202fa49 _start (.../debug_build/bin/clang-6.0+0x202fa49)
Stack dump:
0.      Program arguments: .../debug_build/bin/clang-6.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
test.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 /test.gcno -resource-dir .../debug_build/lib/clang/6.0.0
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/backward
-internal-isystem /usr/local/include -internal-isystem
.../debug_build/lib/clang/6.0.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O0 -fdeprecated-macro
-fdebug-compilation-dir  -ferror-limit 19 -fmessage-length 271
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o test.o -x c++ test.cpp
1.      test.cpp:8:7: current parser token ';'
2.      test.cpp:3:24: instantiating class definition 'B<0>'
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 317212)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: .../last_debug/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ 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/test-f52472.cpp
clang-6.0: note: diagnostic msg: /tmp/test-f52472.sh
clang-6.0: note: diagnostic msg:

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171103/013f7a2c/attachment.html>


More information about the llvm-bugs mailing list