我试图在与Clang.
我在Clang发现了一个bug吗?
[email protected] ~ $ clang++ --version
clang version 2.8 (trunk 107611)
Target: i386-pc-linux-gnu
Thread model: posix
[email protected] ~ $ cat bug.cpp
class Prasoon{
private:
static const int dummy = 0;
};
int const Prasoon::dummy = 0;
int main(){}
[email protected] ~ $ clang++ bug.cpp
[email protected] ~ $
编译但是,当我与g++
编译相同的代码我得到一个错误编译下面的代码与Clang
class Prasoon{
static const int dummy = 0;
};
int const Prasoon::dummy = 0;
int main(){}
上面的代码没有给出任何错误如预期。
[email protected] ~ $ g++ bug.cpp
bug.cpp:8: error: duplicate initialization of ‘Prasoon::dummy’
那么我在Clang
中发现了一个错误?
你正在使用哪个铿锵版本? Mac上的1.5给出与g ++ 4.2.1相同的输出。 – Eiko 2010-08-20 13:38:01
这是在他的示例输出:铿锵2.8版(主干107611) – Douglas 2010-08-20 13:45:22
那么,它不是在编辑之前;-) – Eiko 2010-08-20 14:08:11