@cella-lang/cpp 0.1.202611030134 → 0.1.202611031230

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGES.md CHANGED
@@ -5,8 +5,24 @@
5
5
 
6
6
  ## 未發佈
7
7
 
8
+ - `min({…})`、`max({…})` 的元素有函式呼叫或下標時照樣算(`max({f(1), f(3), 2})`、`min({v[0], v[1], v[2]})`),之前判 unknown;
9
+ 元素直接改東西(`i++`、指定)時照舊不改寫(判 unknown,不是 reject)。
10
+ - 指定的右邊是大括號串列(`A[0] = {1, 2}`、`b = {7}`、`v[0] = {3, 4}`,[expr.ass]p9),之前判 unknown;純量的照樣不准窄化。
11
+ - 範圍 for 的範圍是大括號串列(`for (int q : {1, 10, 15})`,[stmt.ranged]p1):之前判 reject(expression is not assignable)。
12
+ 元素是 const 的([dcl.init.list]p5),元素型別不同或空的串列推導不出型別,判 reject。
13
+ - `set`、`multiset`、`map` 的 `erase(first, last)` 與 `equal_range`,`map` 的 `lower_bound`、`upper_bound`,`string` 的 `erase(first, last)`。
14
+ - 兩個呼叫都只讀容器時(`s.erase(s.begin(), s.find(3))`、`s.find(1) == s.find(2)`),不再判 unknown(求值順序):
15
+ 之前函式裡給指標變數賦值(走訪樹的 `x = x->left`)被當成寫到別處,`find`、`lower_bound`、`begin` 看起來都會寫。
16
+
8
17
  ### ⚠️ 不相容
9
18
 
19
+ - 大括號初始化不准窄化([dcl.init.list]p3.9、p7):`int c = {2.5}`、`int a[2] = {1.5, 2}`、`char c{300}`、`int x{l}`(l 是 long)、
20
+ `double d{x}`(x 是 int 變數)、`unsigned u{-1}` 之前判 accept,現在判 reject(clang 一樣報錯)。常數且裝得下的照舊(`char c{65}`、
21
+ `float f{2.5}`、`double d{3}`);可能是常數運算式的 const 變數判 unknown,不判 reject。
22
+ - 函式庫的類別(std 的容器、字串,Arduino 的類別)的成員呼叫沒有相符的多載時,判 unknown(`unsupported`:「the model's 'X' has
23
+ no overload of 'f' for these arguments」),不再判 reject(no matching member function):模型的多載不一定是標準的全部,程式可能是對的。
24
+ 和「函式庫的類別沒有這個名字的成員」一致;程式自己的類別照舊 reject。代價:呼叫的多載在標準裡也沒有的錯(例如 Uno 的
25
+ `EEPROM.begin(512)`)也變成 unknown。
10
26
  - 判決每個問題的 `class` 改名為 `category`(判決由 @cella-lang/cfamily 產生,見它的變更紀錄)。
11
27
 
12
28
  - `string::compare` 的值照 libc++:第一個不同字元的位元組差(`"apple".compare("apricot")` 是 -2,之前是 -1);標準只規定正負號,
package/cpp.arrays.cell CHANGED
Binary file
package/cpp.cell CHANGED
Binary file
package/cpp.classes.cell CHANGED
Binary file
Binary file
Binary file
package/cpp.copies.cell CHANGED
Binary file
Binary file
Binary file
package/cpp.lambdas.cell CHANGED
Binary file
package/cpp.layouts.cell CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
package/cpp.names.cell CHANGED
Binary file
package/cpp.objects.cell CHANGED
Binary file
Binary file
Binary file
Binary file
package/cpp.ranges.cell CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
package/cpp.streams.cell CHANGED
Binary file
Binary file
Binary file