This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/9393: [3.2/3.3/3.4 regression] Anonymous namespaces and compiling the same file twice


A better testcase is:

#include <iostream>
namespace {
  struct S {
      S();
  };
  S::S () { std::cout << "One more call" << std::endl; }
  S local_s;
}

(you can insert anything you like in the constructor). You can have as many of these as you like in your program.

One additional problem with the existing behaviour is that you get "determinism" only if inode numbers and modification times don't change. This means that (a) it's not reproducible; users normally can't control inode numbers; and (b) it's fragile, because both of these can quietly vary, especially on network file systems.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]