@@ -218,39 +218,50 @@ constexpr int add3(int x, int y = random()) { return x + y; }
218218constexpr int add4 (int x = 1 , int y = 2 ) { return x + y; }
219219
220220constexpr void fp_reported_in_466 (int p) {
221- int x = add (1 , 2 ); // NON_COMPLIANT
222- int y = add (1 , p); // COMPLIANT
221+ int l1 = add (1 , 2 ); // NON_COMPLIANT
222+ int l2 = add (1 , p); // COMPLIANT
223223
224- int z = 0 ;
224+ int l3 = 0 ;
225225 if (p > 0 ) {
226- z = 1 ;
226+ l3 = 1 ;
227227 } else {
228- z = p;
228+ l3 = p;
229229 }
230230
231- constexpr int t = add (1 , 2 ); // COMPLIANT
232-
233- int u = add (z, 2 ); // COMPLIANT - z is not compile time constant on all paths
234- int v = add (t, 2 ); // NON_COMPLIANT
235- int w =
236- add1 (t, 2 ); // NON_COMPLIANT - all arguments are compile time constants
237- int a = add1 (t); // NON_COMPLIANT - s and the default value of the second
238- // argument are compile time constants
239- int b = add1 (1 ); // NON_COMPLIANT
240- int c = add1 (1 , z); // COMPLIANT - z is not compile time constant on all paths
241- int d = add1 (z); // COMPLIANT - z is not compile time constant on all paths
242- int e = add2 (1 ); // NON_COMPLIANT - provided argument and default value are
243- // compile time constants
244- int f = add2 (1 , 2 ); // NON_COMPLIANT
245- int g = add2 (t, 2 ); // NON_COMPLIANT
246- int h = add2 (z); // COMPLIANT - z is not compile time constant on all paths
247- int i = add2 (z, 1 ); // COMPLIANT - z is not compile time constant on all paths
248- int j = add3 (1 , 1 ); // NON_COMPLIANT
249- int k = add3 (1 ); // COMPLIANT - default value for second argument is not a
250- // compile time constant
251- int l = add3 (1 , z); // COMPLIANT - z is not compile time constant on all paths
252- int m = add4 (); // NON_COMPLIANT - default values are compile time constants
253- int n = add4 (1 ); // NON_COMPLIANT - default value for second argument is a
254- // compile time constant
255- int o = add4 (1 , z); // COMPLIANT - z is not compile time constant on all paths
231+ constexpr int l4 = add (1 , 2 ); // COMPLIANT
232+
233+ int l5 =
234+ add (l3, 2 ); // COMPLIANT - l3 is not compile time constant on all paths
235+ int l6 = add (l4, 2 ); // NON_COMPLIANT
236+ int l7 = add (l1, 2 ); // COMPLIANT - l1 is not constexpr
237+ int l8 =
238+ add1 (l4, 2 ); // NON_COMPLIANT - all arguments are compile time constants
239+ int l9 = add1 (l1, 2 ); // COMPLIANT - l1 is not constexpr
240+ int l10 = add1 (l4); // NON_COMPLIANT - argument and the default value of the
241+ // second argument are compile time constants
242+ int l11 = add1 (l1); // COMPLIANT - l1 is not constexpr
243+ int l12 = add1 (1 ); // NON_COMPLIANT
244+ int l13 =
245+ add1 (1 , l3); // COMPLIANT - l3 is not compile time constant on all paths
246+ int l14 =
247+ add1 (l3); // COMPLIANT - l3 is not compile time constant on all paths
248+ int l15 = add2 (1 ); // NON_COMPLIANT - provided argument and default value are
249+ // compile time constants
250+ int l16 = add2 (1 , 2 ); // NON_COMPLIANT
251+ int l17 = add2 (l4, 2 ); // NON_COMPLIANT
252+ int l18 = add2 (l1, 2 ); // COMPLIANT - l1 is not constexpr
253+ int l19 =
254+ add2 (l3); // COMPLIANT - l3 is not compile time constant on all paths
255+ int l20 =
256+ add2 (l3, 1 ); // COMPLIANT - l3 is not compile time constant on all paths
257+ int l21 = add3 (1 , 1 ); // NON_COMPLIANT
258+ int l22 = add3 (1 ); // COMPLIANT - default value for second argument is not a
259+ // compile time constant
260+ int l23 =
261+ add3 (1 , l3); // COMPLIANT - l3 is not compile time constant on all paths
262+ int l24 = add4 (); // NON_COMPLIANT - default values are compile time constants
263+ int l25 = add4 (1 ); // NON_COMPLIANT - default value for second argument is a
264+ // compile time constant
265+ int l26 =
266+ add4 (1 , l3); // COMPLIANT - l3 is not compile time constant on all paths
256267}
0 commit comments