Commit Graph

6 Commits

Author SHA1 Message Date
Galina Kistanova 45fbb597ec Added braces to work around gcc warning in googletest: suggest explicit braces to avoid ambiguous 'else'. NFC.
llvm-svn: 305507
2017-06-15 21:01:24 +00:00
Reid Kleckner 9e749f6636 Avoid lambdas in default member initializers to work around clang bug
On Windows, Clang is mangling lambdas in default member initializers
incorrectly. See PR31197.

This is causing redness on the self-host bots. Work around the problem
locally so we aren't blind to further issues.

llvm-svn: 288089
2016-11-28 23:58:04 +00:00
Eric Liu 6135581cdf Do not do raw name replacement when FromDecl is a class forward-declaration.
Summary:
If the `FromDecl` is a class forward declaration, the reference is
still considered as referring to the original definition given the nature
of forward-declarations, so we can't do a raw name replacement in this case.

Reviewers: bkramer

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D27132

llvm-svn: 287929
2016-11-25 16:02:49 +00:00
Eric Liu eddec09ee4 Consider nested namespaces in the canonical namespace as canonical as well.
Summary:
For example, this case was missed when looking for different but canonical
namespaces. UseContext in this case should be considered as in the canonical
namespace.
```
namespace a { namespace b { <FromContext> } }
namespace a { namespace b { namespace c { <UseContext> } } }
```
Added some commenting.

Reviewers: bkramer

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D27125

llvm-svn: 287924
2016-11-25 12:39:03 +00:00
Eric Liu df5bcea088 [Tooling] skip anonymous namespaces when checking if typeLoc references a type decl from a different canonical namespace.
Summary:
[Tooling] skip anonymous namespaces when checking if typeLoc
references a type decl from a different canonical namespace.

Reviewers: bkramer

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D22808

llvm-svn: 276754
2016-07-26 14:53:05 +00:00
Benjamin Kramer 9bccaa158a [Tooling] Add a utility function to replace one nested name with another.
One problem in clang-tidy and other clang tools face is that there is no
way to lookup an arbitrary name in the AST, that's buried deep inside Sema
and might not even be what the user wants as the new name may be freshly
inserted and not available in the AST.

A common use case for lookups is replacing one nested name with another
while minimizing namespace qualifications, so replacing 'ns::foo' with
'ns::bar' will use just 'bar' if we happen to be inside the namespace 'ns'.
This adds a little helper utility for exactly that use case.

Differential Revision: http://reviews.llvm.org/D13931

llvm-svn: 251022
2015-10-22 15:04:10 +00:00