diff options
author | John McCall <rjmccall@apple.com> | 2013-03-09 00:54:27 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2013-03-09 00:54:27 +0000 |
commit | 83972f128e9218c051692bf96361327a701aeb79 (patch) | |
tree | e1129b0ffc979ac9bcd90848b3a7381dac57bda0 /lib/Sema/SemaChecking.cpp | |
parent | b421b56d5a83c5bcae576b714ebd9df7b745368d (diff) |
Add TagDecl::hasNameForLinkage(), which is true if the tag
is non-anonymous or is defined in a typedef of itself.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176742 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index e9d9791318..be0480b9f1 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -5026,10 +5026,8 @@ void CheckImplicitConversion(Sema &S, Expr *E, QualType T, if (const EnumType *SourceEnum = Source->getAs<EnumType>()) if (const EnumType *TargetEnum = Target->getAs<EnumType>()) - if ((SourceEnum->getDecl()->getIdentifier() || - SourceEnum->getDecl()->getTypedefNameForAnonDecl()) && - (TargetEnum->getDecl()->getIdentifier() || - TargetEnum->getDecl()->getTypedefNameForAnonDecl()) && + if (SourceEnum->getDecl()->hasNameForLinkage() && + TargetEnum->getDecl()->hasNameForLinkage() && SourceEnum != TargetEnum) { if (S.SourceMgr.isInSystemMacro(CC)) return; |