Quellcode durchsuchen

[Sema] Fix incorrect enum token namespace

Summary:
This patch fix the scoping of enum literal. They were not resolving
to the right type.

It was not causing any problem as one is a copy of the other one.

The literal in the switch are resolving to Sema.h:5527
```
  enum AccessResult {
    AR_accessible,
    AR_inaccessible,
    AR_dependent,
    AR_delayed
  };
```

Instead of SemaAccess.cpp:27
```
/// A copy of Sema's enum without AR_delayed.
enum AccessResult {
  AR_accessible,
  AR_inaccessible,
  AR_dependent
};
```

This issue was found by a new clang-tidy check (still on-going).

Reviewers: rsmith, aaron.ballman

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271431 91177308-0d34-0410-b5e6-96231b3b80d8
Etienne Bergeron vor 9 Jahren
Ursprung
Commit
06caa0fe00
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. 3 3
      lib/Sema/SemaAccess.cpp

+ 3 - 3
lib/Sema/SemaAccess.cpp

@@ -1766,9 +1766,9 @@ Sema::AccessResult Sema::CheckFriendAccess(NamedDecl *target) {
   // while the ParsingDeclarator is active.
   EffectiveContext EC(CurContext);
   switch (CheckEffectiveAccess(*this, EC, target->getLocation(), entity)) {
-  case AR_accessible: return Sema::AR_accessible;
-  case AR_inaccessible: return Sema::AR_inaccessible;
-  case AR_dependent: return Sema::AR_dependent;
+  case ::AR_accessible: return Sema::AR_accessible;
+  case ::AR_inaccessible: return Sema::AR_inaccessible;
+  case ::AR_dependent: return Sema::AR_dependent;
   }
   llvm_unreachable("invalid access result");
 }