fork download
  1. #include <iostream>
  2. using std::cout;
  3. using std::endl;
  4.  
  5. inline double fd() { return 1.0; }
  6. extern double d1;
  7. double d2 = d1; // unspecified:
  8. // may be statically initialized to 0.0 or
  9. // dynamically initialized to 0.0 if d1 is
  10. // dynamically initialized, or 1.0 otherwise
  11. double d1 = fd(); // may be initialized statically or dynamically to 1.0
  12.  
  13. int main() {
  14. cout << "d1: " << d1 << endl;
  15. cout << "d2: " << d2 << endl;
  16. }
Success #stdin #stdout 0s 5624KB
stdin
Standard input is empty
stdout
d1: 1
d2: 0