貓TEST.CPP鐺Unicode字符變量名
#include <iostream>
int main() {
int à;
}
結果:
clang++ test.cpp
test.cpp:4:7: error: expected unqualified-id
int à;
^
1 error generated.
現在,有一種方式來獲得鐺,以允許使用Unicode變量名?
謝謝!
貓TEST.CPP鐺Unicode字符變量名
#include <iostream>
int main() {
int à;
}
結果:
clang++ test.cpp
test.cpp:4:7: error: expected unqualified-id
int à;
^
1 error generated.
現在,有一種方式來獲得鐺,以允許使用Unicode變量名?
謝謝!
雖然標準允許這樣做,但Clang目前不支持標識符中的UCN(通用字符名稱)。
對Clang使用Unicode有沒有其他限制?例如,不在評論/字符串中,...? – 2011-06-13 03:49:32
Clang支持註釋和字符串中的UCN。雖然我不確定源字符集必須是什麼,或者它轉換爲什麼。 – 2011-06-13 06:10:44
在標識符內部有Unicode字符是標準C嗎? – zneak 2010-04-21 22:30:59
'clang ++'3.4支持這個。自3.3以來(http://llvm.org/releases/3.3/tools/clang/docs/ReleaseNotes.html#major-new-features) – alfC 2014-10-30 17:46:47