<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 assertion "Instantiated local in inner and outer scopes""
   href="https://bugs.llvm.org/show_bug.cgi?id=36872">36872</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang crashes on assertion "Instantiated local in inner and outer scopes"
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>5.0
          </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>normal
          </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>benoit.belley@autodesk.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Assertion failed: (Current->LocalDecls.find(D) == Current->LocalDecls.end() &&
"Instantiated local in inner and outer scopes"), function InstantiatedLocal,
file
/Users/benoit/src/amino-llvm-build/git/clang/lib/Sema/SemaTemplateInstantiate.cpp,
line 2925.
    0  clang-5.0                0x000000010dc1545c
decltype(make_range(fp.rbegin()fp.rend()))
llvm::reverse<std::__1::vector<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >,
std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > > >&>(std::__1::vector<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >,
std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > > >&&&,
std::__1::enable_if<has_rbegin<std::__1::vector<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >,
std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > > >&>::value, void>::type*) + 1660
    1  clang-5.0                0x000000010dc15a59
decltype(make_range(fp.rbegin()fp.rend()))
llvm::reverse<std::__1::vector<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >,
std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > > >&>(std::__1::vector<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >,
std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > > >&&&,
std::__1::enable_if<has_rbegin<std::__1::vector<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >,
std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > > >&>::value, void>::type*) + 3193
    2  clang-5.0                0x000000010dc11429
std::__1::shared_ptr<llvm::sys::fs::detail::DirIterState>
std::__1::shared_ptr<llvm::sys::fs::detail::DirIterState>::make_shared<>() +
38713
    3  clang-5.0                0x000000010dc161f2
decltype(make_range(fp.rbegin()fp.rend()))
llvm::reverse<std::__1::vector<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >,
std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > > >&>(std::__1::vector<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >,
std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > > >&&&,
std::__1::enable_if<has_rbegin<std::__1::vector<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >,
std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > > >&>::value, void>::type*) + 5138
    4  libsystem_platform.dylib 0x00007fff7360ef5a _sigtramp + 26
    5  clang-5.0                0x000000010dea2741
std::__1::vector<std::__1::pair<clang::DiagnosticIDs::Level,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > >,
std::__1::allocator<std::__1::pair<clang::DiagnosticIDs::Level,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > > > >::max_size() const + 2929
    6  libsystem_c.dylib        0x00007fff73439312 abort + 127
    7  libsystem_c.dylib        0x00007fff73401368 basename_r + 0
    8  clang-5.0                0x000000011112c5d3
clang::TemplateSpecializationType const*
clang::Type::castAs<clang::TemplateSpecializationType>() const + 49811
    9  clang-5.0                0x00000001111a4f14 clang::Decl*
clang::TemplateDeclInstantiator::instantiateUnresolvedUsingDecl<clang::UnresolvedUsingValueDecl>(clang::UnresolvedUsingValueDecl*,
bool) + 14900
    10 clang-5.0                0x00000001111a60be clang::Decl*
clang::TemplateDeclInstantiator::instantiateUnresolvedUsingDecl<clang::UnresolvedUsingValueDecl>(clang::UnresolvedUsingValueDecl*,
bool) + 19422
    11 clang-5.0                0x00000001111a9b61 clang::Decl*
clang::TemplateDeclInstantiator::instantiateUnresolvedUsingDecl<clang::UnresolvedUsingValueDecl>(clang::UnresolvedUsingValueDecl*,
bool) + 34433
    12 clang-5.0                0x000000011119c91d clang::TagType const*
clang::Type::castAs<clang::TagType>() const + 48797
    13 clang-5.0                0x00000001111a6375 clang::Decl*
clang::TemplateDeclInstantiator::instantiateUnresolvedUsingDecl<clang::UnresolvedUsingValueDecl>(clang::UnresolvedUsingValueDecl*,
bool) + 20117
    14 clang-5.0                0x00000001111a9b61 clang::Decl*
clang::TemplateDeclInstantiator::instantiateUnresolvedUsingDecl<clang::UnresolvedUsingValueDecl>(clang::UnresolvedUsingValueDecl*,
bool) + 34433
    15 clang-5.0                0x00000001106964ee
llvm::iterator_range<std::__1::reverse_iterator<clang::sema::FunctionScopeInfo::WeakUseTy*>
>
llvm::make_range<std::__1::reverse_iterator<clang::sema::FunctionScopeInfo::WeakUseTy*>
<span class="quote">>(std::__1::reverse_iterator<clang::sema::FunctionScopeInfo::WeakUseTy*>,</span >
std::__1::reverse_iterator<clang::sema::FunctionScopeInfo::WeakUseTy*>) + 46766
    16 clang-5.0                0x000000011023d998
clang::ParsedTemplateArgument*
std::__1::uninitialized_copy<std::__1::move_iterator<clang::ParsedTemplateArgument*>,
clang::ParsedTemplateArgument*>(std::__1::move_iterator<clang::ParsedTemplateArgument*>,
std::__1::move_iterator<clang::ParsedTemplateArgument*>,
clang::ParsedTemplateArgument*) + 53992
    17 clang-5.0                0x000000011013f258
llvm::sampleprof::FunctionSamples**
std::__1::uninitialized_copy<std::__1::move_iterator<llvm::sampleprof::FunctionSamples**>,
llvm::sampleprof::FunctionSamples**>(std::__1::move_iterator<llvm::sampleprof::FunctionSamples**>,
std::__1::move_iterator<llvm::sampleprof::FunctionSamples**>,
llvm::sampleprof::FunctionSamples**) + 2376
    18 clang-5.0                0x000000010eab0171
std::__1::enable_if<!(std::is_array<clang::MultiplexConsumer>::value),
std::__1::unique_ptr<clang::MultiplexConsumer,
std::__1::default_delete<clang::MultiplexConsumer> > >::type
llvm::make_unique<clang::MultiplexConsumer,
std::__1::vector<std::__1::unique_ptr<clang::ASTConsumer,
std::__1::default_delete<clang::ASTConsumer> >,
std::__1::allocator<std::__1::unique_ptr<clang::ASTConsumer,
std::__1::default_delete<clang::ASTConsumer> > > >
<span class="quote">>(std::__1::vector<std::__1::unique_ptr<clang::ASTConsumer,</span >
std::__1::default_delete<clang::ASTConsumer> >,
std::__1::allocator<std::__1::unique_ptr<clang::ASTConsumer,
std::__1::default_delete<clang::ASTConsumer> > > >&&) + 49025
    19 clang-5.0                0x000000010e395a1f
std::__1::enable_if<!(std::is_array<clang::MacroPPCallbacks>::value),
std::__1::unique_ptr<clang::MacroPPCallbacks,
std::__1::default_delete<clang::MacroPPCallbacks> > >::type
llvm::make_unique<clang::MacroPPCallbacks, clang::CodeGenerator*,
clang::Preprocessor&>(clang::CodeGenerator*&&, clang::Preprocessor&&&) + 9215
    20 clang-5.0                0x000000010eaaf0c0
std::__1::enable_if<!(std::is_array<clang::MultiplexConsumer>::value),
std::__1::unique_ptr<clang::MultiplexConsumer,
std::__1::default_delete<clang::MultiplexConsumer> > >::type
llvm::make_unique<clang::MultiplexConsumer,
std::__1::vector<std::__1::unique_ptr<clang::ASTConsumer,
std::__1::default_delete<clang::ASTConsumer> >,
std::__1::allocator<std::__1::unique_ptr<clang::ASTConsumer,
std::__1::default_delete<clang::ASTConsumer> > > >
<span class="quote">>(std::__1::vector<std::__1::unique_ptr<clang::ASTConsumer,</span >
std::__1::default_delete<clang::ASTConsumer> >,
std::__1::allocator<std::__1::unique_ptr<clang::ASTConsumer,
std::__1::default_delete<clang::ASTConsumer> > > >&&) + 44752
    21 clang-5.0                0x000000010e9c7c0b
std::__1::enable_if<!(std::is_array<llvm::raw_null_ostream>::value),
std::__1::unique_ptr<llvm::raw_null_ostream,
std::__1::default_delete<llvm::raw_null_ostream> > >::type
llvm::make_unique<llvm::raw_null_ostream>() + 26507
    22 clang-5.0                0x000000010eb63f4f
std::__1::vector<clang::VerifyDiagnosticConsumer::Directive*,
std::__1::allocator<clang::VerifyDiagnosticConsumer::Directive*> >::max_size()
const + 21919
    23 clang-5.0                0x000000010ac5829f char const**
std::__1::uninitialized_copy<std::__1::move_iterator<char const**>, char
const**>(std::__1::move_iterator<char const**>, std::__1::move_iterator<char
const**>, char const**) + 13343
    24 clang-5.0                0x000000010ac4759e char const**
std::__1::remove<char const**, std::nullptr_t>(char const**, char const**,
std::nullptr_t const&) + 1294
    25 clang-5.0                0x000000010ac4484b
    26 libdyld.dylib            0x00007fff7338d115 start + 1
    Stack dump:
    0.  Program arguments:
/Users/benoit/src/amino-llvm-build/wks-5.0.1/install/Debug/llvm/5.0.1-p1/Debug/bin/clang-5.0
-cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage
-Werror=deprecated-objc-isa-usage -emit-obj -disable-free -main-file-name
DmMessageLog.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix
-mdisable-fp-elim -masm-verbose -munwind-tables -faligned-alloc-unavailable
-target-cpu westmere -target-feature +sse4.2 -target-linker-version 305
-dwarf-column-info -debug-info-kind=standalone -dwarf-version=4
-debugger-tuning=lldb -coverage-notes-file
/Users/benoit/src/ecg-components/build-san/amino/RelWithDebInfo/src/datamodel/CMakeFiles/AminoDataModelReg.dir/DmMessageLog.cpp.gcno
-nostdinc++ -resource-dir
/Users/benoit/src/amino-llvm-build/wks-5.0.1/install/Debug/llvm/5.0.1-p1/Debug/lib/clang/5.0.1
-dependency-file
src/datamodel/CMakeFiles/AminoDataModelReg.dir/DmMessageLog.cpp.o.d
-sys-header-deps -MT
src/datamodel/CMakeFiles/AminoDataModelReg.dir/DmMessageLog.cpp.o -isystem
/Users/benoit/src/Artifactory/OSX/boost/1.64.0-san/Release/c189fe8/include
-isystem
/Users/benoit/src/Artifactory/OSX/llvm/5.0.1-p1-san/RelWithDebInfo/b754657/include
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
-cxx-isystem
/Users/benoit/src/amino-llvm-build/wks-5.0.1/install/Debug/llvm/5.0.1-p1/Debug/include/c++/v1
-D AMINO_BUILD_DATAMODEL_DLL -D BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY -D
PEPTIDE_RELEASE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D
__STDC_LIMIT_MACROS -I include -I
/Users/benoit/src/ecg-components/git/amino/src -D NDEBUG -stdlib=libc++ -O3
-Weverything -Werror -Wno-c99-extensions -Wno-c++98-compat
-Wno-c++98-compat-pedantic -Wno-switch-enum -Wno-global-constructors
-Wno-exit-time-destructors -Wno-padded -Wno-missing-noreturn
-Wno-documentation-unknown-command -Wno-undefined-func-template
-Wno-sign-conversion -Wno-weak-template-vtables -Wno-documentation
-Wno-zero-as-null-pointer-constant -Wno-error=deprecated-declarations
-std=c++14 -fdeprecated-macro -fdebug-compilation-dir
/Users/benoit/src/ecg-components/build-san/amino/RelWithDebInfo -ferror-limit
19 -fmessage-length 0 -fvisibility hidden -fvisibility-inlines-hidden
-fsanitize=address,alignment,array-bounds,bool,enum,float-cast-overflow,float-divide-by-zero,integer-divide-by-zero,nonnull-attribute,null,pointer-overflow,return,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,unreachable,vla-bound
-fsanitize-blacklist=/Users/benoit/src/amino-llvm-build/wks-5.0.1/install/Debug/llvm/5.0.1-p1/Debug/lib/clang/5.0.1/asan_blacklist.txt
-fsanitize-address-use-after-scope -fsanitize-address-globals-dead-stripping
-fno-assume-sane-operator-new -stack-protector 1 -fblocks
-fobjc-runtime=macosx-10.11.0 -fencode-extended-block-signature
-fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option
-vectorize-loops -vectorize-slp -o
src/datamodel/CMakeFiles/AminoDataModelReg.dir/DmMessageLog.cpp.o -x c++
/Users/benoit/src/ecg-components/git/amino/src/datamodel/DmMessageLog.cpp
    1.  <eof> parser at end of file
    2. 
/Users/benoit/src/ecg-components/git/amino/src/datamodel/DmMessageLog.cpp:238:27:
instantiating function definition 'Amino::DmMessageLogger::reportError(const
Amino::DmMessageReportPtr &)::(anonymous
class)::operator()<std::__1::shared_ptr<Amino::DmMessageReport>, (lambda at
/Users/benoit/src/ecg-components/git/amino/src/datamodel/DmMessageLog.cpp:238:27)>'
    3. 
/Users/benoit/src/ecg-components/git/amino/src/datamodel/DmMessageLog.cpp:238:27:
instantiating function definition 'Amino::DmMessageLogger::reportError(const
Amino::DmMessageReportPtr &)::(anonymous
class)::operator()<std::__1::shared_ptr<Amino::BaMessageRecord>, (lambda at
/Users/benoit/src/ecg-components/git/amino/src/datamodel/DmMessageLog.cpp:238:27)>'
    clang-5.0: error: unable to execute command: Abort trap: 6
    clang-5.0: error: clang frontend command failed due to signal (use -v to
see invocation)
    clang version 5.0.1 (<a href="https://git.llvm.org/git/clang">https://git.llvm.org/git/clang</a>
fa0433652ad9c6ec385e803a708dbacfe6e108c2) (<a href="https://git.llvm.org/git/llvm">https://git.llvm.org/git/llvm</a>
1368f4044e62cad4316da638d919a93fd3ac3fe6)
    Target: x86_64-apple-darwin17.4.0
    Thread model: posix
    InstalledDir:
/Users/benoit/src/amino-llvm-build/wks-5.0.1/install/Debug/llvm/5.0.1-p1/Debug/bin
    clang-5.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-5.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-5.0: note: diagnostic msg:
/var/folders/zf/7lcmj1mj28jcwfn9krlvs2940000gp/T/DmMessageLog-2bb861.cpp
    clang-5.0: note: diagnostic msg:
/var/folders/zf/7lcmj1mj28jcwfn9krlvs2940000gp/T/DmMessageLog-2bb861.sh
    clang-5.0: note: diagnostic msg: Crash backtrace is located in
    clang-5.0: note: diagnostic msg:
/Users/benoit/Library/Logs/DiagnosticReports/clang-5.0_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
    clang-5.0: note: diagnostic msg: (choose the .crash file that corresponds
to your crash)
    clang-5.0: note: diagnostic msg:

    ********************</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>