LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 38785 - build failure : DWARFDebugInfoTest.cpp: error: no member named 'base' in 'std::reverse_iterator<llvm::DWARFDie::iterator>
Summary: build failure : DWARFDebugInfoTest.cpp: error: no member named 'base' in 'std...
Status: RESOLVED FIXED
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: trunk
Hardware: PC Linux
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-30 22:37 PDT by Matthias Krüger
Modified: 2018-11-01 13:40 PDT (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Krüger 2018-08-30 22:37:17 PDT
This cmake config fails to build https://github.com/matthiaskrgr/llvm_bootstrap/blob/master/build_7_0.sh#L219

[  4%/35/6/758,106.111] Building CXX object unittests/DebugInfo/DWARF/CMakeFiles/DebugInfoDWARFTests.dir/DWARFDebugInfoTest.cpp.o
FAILED: unittests/DebugInfo/DWARF/CMakeFiles/DebugInfoDWARFTests.dir/DWARFDebugInfoTest.cpp.o
/home/matthias/LLVM/LLVM_dev/stage_2/build/bin/clang++  -DEXPENSIVE_CHECKS -DGTEST_HAS_RTTI=0 -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_LANG_CXX11=1 -D_DEBUG -D_GLIBCXX_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iunittests/DebugInfo/DWARF -I/home/matthias/LLVM/LLVM_dev/stage_3_tests/llvm-project-20170507/llvm/unittests/DebugInfo/DWARF -I/usr/include/libxml2 -Iinclude -I/home/matthias/LLVM/LLVM_dev/stage_3_tests/llvm-project-20170507/llvm/include -I/home/matthias/LLVM/LLVM_dev/stage_3_tests/llvm-project-20170507/llvm/utils/unittest/googletest/include -I/home/matthias/LLVM/LLVM_dev/stage_3_tests/llvm-project-20170507/llvm/utils/unittest/googlemock/include -O3  -D_GLIBCXX_DEBUG -g0 -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -flto=full -O3    -UNDEBUG  -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -fno-rtti -MD -MT unittests/DebugInfo/DWARF/CMakeFiles/DebugInfoDWARFTests.dir/DWARFDebugInfoTest.cpp.o -MF unittests/DebugInfo/DWARF/CMakeFiles/DebugInfoDWARFTests.dir/DWARFDebugInfoTest.cpp.o.d -o unittests/DebugInfo/DWARF/CMakeFiles/DebugInfoDWARFTests.dir/DWARFDebugInfoTest.cpp.o -c /home/matthias/LLVM/LLVM_dev/stage_3_tests/llvm-project-20170507/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
In file included from /home/matthias/LLVM/LLVM_dev/stage_3_tests/llvm-project-20170507/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp:10:
In file included from /home/matthias/LLVM/LLVM_dev/stage_3_tests/llvm-project-20170507/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:17:
In file included from /home/matthias/LLVM/LLVM_dev/stage_3_tests/llvm-project-20170507/llvm/include/llvm/ADT/StringRef.h:13:
In file included from /home/matthias/LLVM/LLVM_dev/stage_3_tests/llvm-project-20170507/llvm/include/llvm/ADT/STLExtras.h:20:
In file included from /home/matthias/LLVM/LLVM_dev/stage_3_tests/llvm-project-20170507/llvm/include/llvm/ADT/Optional.h:23:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../include/c++/8.2.0/algorithm:61:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../include/c++/8.2.0/bits/stl_algobase.h:67:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../include/c++/8.2.0/bits/stl_iterator.h:1272:
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../include/c++/8.2.0/debug/stl_iterator.h:42:35: error: no member named 'base' in 'std::reverse_iterator<llvm::DWARFDie::iterator>'
    { return __valid_range(__last.base(), __first.base(), __dist); }
                           ~~~~~~ ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../include/c++/8.2.0/debug/helper_functions.h:164:14: note: in instantiation of function template specialization '__gnu_debug::__valid_range<llvm::DWARFDie::iterator>' requested here
      return __valid_range(__first, __last, __dist);
             ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../include/c++/8.2.0/debug/functions.h:93:7: note: in instantiation of function template specialization '__gnu_debug::__valid_range<std::reverse_iterator<llvm::DWARFDie::iterator> >' requested here
      __glibcxx_check_valid_range(__first, __last);
      ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../include/c++/8.2.0/debug/macros.h:54:36: note: expanded from macro '__glibcxx_check_valid_range'
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__valid_range(_First, _Last),        \
                                   ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../include/c++/8.2.0/debug/vector:185:43: note: in instantiation of function template specialization '__gnu_debug::__check_valid_range<std::reverse_iterator<llvm::DWARFDie::iterator> >' requested here
        : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
                                                 ^
/home/matthias/LLVM/LLVM_dev/stage_3_tests/llvm-project-20170507/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp:1227:15: note: in instantiation of function template specialization 'std::__debug::vector<llvm::DWARFDie, std::allocator<llvm::DWARFDie> >::vector<std::reverse_iterator<llvm::DWARFDie::iterator>, void>' requested here
  EXPECT_THAT(std::vector<DWARFDie>(A.rbegin(), A.rend()),
              ^
1 error generated.


git monorepo is at cd36334ebd6a3f9ac9a7a87de844a40c3b9c34a3
host compiler was clang-dev (8.0)
Comment 1 Eugene Sharygin 2018-10-21 12:55:23 PDT
This bug is triggered by `-D_GLIBCXX_DEBUG` (which is part of `LLVM_ENABLE_EXPENSIVE_CHECKS`) and may have been caused by [D49679] which added the specialization `std::reverse_iterator<llvm::DWARFDie::iterator>` that lacks `base()`.

[D49679]: https://reviews.llvm.org/D49679
Comment 2 Eugene Sharygin 2018-11-01 13:40:38 PDT
Fixed in https://reviews.llvm.org/rL345621.