[PATCH] D35783: Ignore shadowing for declarations coming from within macros.

Kim Gräsman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 23 23:29:47 PDT 2017


kimgr added a comment.

I've seen this in the wild:

  #define LOG(m) \
      {  \
        std::ostringstream os;  \
        os << m << "\n";  \
        LogWrite(os.str());  \
      }
  
  auto os = GetOSName();
  LOG("The OS is " << os);

It looks like your patch would miss this case. Not sure if current Clang catches it either, though, I don't remember the exact symptoms when we found this.


https://reviews.llvm.org/D35783





More information about the cfe-commits mailing list