1
我使用包含在Xcode 4.6.2(4H1003)中的Clang。常量類型在C++中的常量別名11
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
目前我的編譯器不會爲此代碼編譯錯誤。
using AA = int const;
static AA const aa = 0;
因爲我不熟悉準確的C++ 11規格,我不知道什麼是正確的行爲。
- 雙重錯誤
const
關鍵字。 const
onusing
是不允許的。- 這是一些特殊情況。
- 這是編譯器錯誤。
標準的預期行爲是什麼?
[dcl.type.cv]/1 「冗餘CV-資格被忽略[注:例如,這些可以通過typedefs.年底注]出臺」 – dyp
我的問題是相關或複製到這一個:http://stackoverflow.com/questions/5781222/duplicate-const-qualifier-allowed-in-c-but-not-in-c – Eonil
可能的重複[爲什麼編譯器不給錯誤當typedef常量指針與額外的常量?](http://stackoverflow.com/questions/11534126/why-compiler-doesnt-give-error-when-typedef-const-pointer-is-used-with-extra- CO) – Eonil