aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/SourceLocation.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-17 00:42:38 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-17 00:42:38 +0000
commit0b7a158d120ac8d78c114a823e17eedfec6b6658 (patch)
tree06cb618c16a5c1e606f20e137a6be209ddb8bbe1 /include/clang/Basic/SourceLocation.h
parent41f2b32df5faff10c305ef1892fcb02846e4f489 (diff)
Teach DeclContext how to find the primary declaration for any TagDecl
even when we are still defining the TagDecl. This is required so that qualified name lookup of a class name within its definition works (see the new bits in test/SemaCXX/qualified-id-lookup.cpp). As part of this, move the nested redefinition checking code into ActOnTag. This gives us diagnostics earlier (when we try to perform the nested redefinition, rather than when we try to complete the 2nd definition) and removes some code duplication. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62386 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceLocation.h')
-rw-r--r--include/clang/Basic/SourceLocation.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h
index da7ea25a54..ba359bddae 100644
--- a/include/clang/Basic/SourceLocation.h
+++ b/include/clang/Basic/SourceLocation.h
@@ -253,17 +253,20 @@ public:
/// Prints information about this FullSourceLoc to stderr. Useful for
/// debugging.
void dump() const;
-};
-inline bool operator==(const FullSourceLoc &LHS, const FullSourceLoc &RHS) {
- return LHS.getRawEncoding() == RHS.getRawEncoding() &&
- &LHS.getManager() == &RHS.getManager();
-}
+ friend inline bool
+ operator==(const FullSourceLoc &LHS, const FullSourceLoc &RHS) {
+ return LHS.getRawEncoding() == RHS.getRawEncoding() &&
+ LHS.SrcMgr == RHS.SrcMgr;
+ }
-inline bool operator!=(const FullSourceLoc &LHS, const FullSourceLoc &RHS) {
- return !(LHS == RHS);
-}
-
+ friend inline bool
+ operator!=(const FullSourceLoc &LHS, const FullSourceLoc &RHS) {
+ return !(LHS == RHS);
+ }
+
+};
+
} // end namespace clang
#endif