[llvm-bugs] [Bug 42248] New: ICE when bool is #defined/typedef'd
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Jun 12 01:34:10 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=42248
Bug ID: 42248
Summary: ICE when bool is #defined/typedef'd
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: zhonghao at pku.org.cn
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
My clang is 9.0.0, and the code is:
typedef bool _Bool;
# define bool _Bool
#include <vector>
#include <iostream>
#include <cstring>
using namespace std;
class Test : public vector<string> {
public:
Test (Test& that) {
arr = std::move(that.arr);
}
private:
std::vector<int*> arr;
};
It triggers an ICE:
In file included from
/home/haozhong/project/approach/compilerpara/gcc/tmp/gcc_54207/code0.c.cpp:4:
In file included from
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/vector:60:
In file included from
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/stl_algobase.h:63:
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/ext/numeric_traits.h:63:25:{63:7-63:24}:
error: expected member name or ';' after declaration specifiers
static const bool __is_signed = __glibcxx_signed(_Value);
~~~~~~~~~~~~~~~~~ ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/ext/numeric_traits.h:74:50:
error: expected unqualified-id
const bool __numeric_traits_integer<_Value>::__is_signed;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/ext/numeric_traits.h:106:25:{106:7-106:24}:
error: expected member name or ';' after declaration specifiers
static const bool __is_signed = true;
~~~~~~~~~~~~~~~~~ ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/ext/numeric_traits.h:115:51:
error: expected unqualified-id
const bool __numeric_traits_floating<_Value>::__is_signed;
^
In file included from
/home/haozhong/project/approach/compilerpara/gcc/tmp/gcc_54207/code0.c.cpp:4:
In file included from
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/vector:60:
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/stl_algobase.h:935:49:
error: expected unqualified-id
&& !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/stl_algobase.h:940:45:
error: non-type template argument is not a constant expression
return std::__lexicographical_compare<__simple>::__lc(__first1, __last1,
^
In file included from
/home/haozhong/project/approach/compilerpara/gcc/tmp/gcc_54207/code0.c.cpp:5:
In file included from
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/iostream:39:
In file included from
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/ostream:38:
In file included from
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/ios:44:
In file included from
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/basic_ios.h:37:
In file included from
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/locale_facets.h:2651:
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/locale_facets.tcc:472:57:
error: expected unqualified-id
(__negative && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/locale_facets.tcc:576:44:
error: expected unqualified-id
&& __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/locale_facets.tcc:899:48:
error: expected unqualified-id
&& __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
--
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/20190612/dba508d9/attachment.html>
More information about the llvm-bugs
mailing list