diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-07-14 23:40:24 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-07-14 23:40:24 +0000 |
commit | 37de611c0f4deb72ac85aac4381622cd355bdd26 (patch) | |
tree | c7e5e439b66f1514284449b61fe48a1fb6cfd216 /clang/lib/AST/ExprCXX.cpp | |
parent | 6be46b8ae56b7c20db9d46496940b678eef22771 (diff) | |
download | bcm5719-llvm-37de611c0f4deb72ac85aac4381622cd355bdd26.tar.gz bcm5719-llvm-37de611c0f4deb72ac85aac4381622cd355bdd26.zip |
AST: Fix __uuidof for template specializations
While we previously supported __uuidof applied to a template
specialization, we would only find the uuid attribute if it was applied
to the template argument. We would erroneously ignore the uuid
attribute on the specialization itself.
This is required to parse Windows Runtime C++ Template Library headers.
llvm-svn: 213016
Diffstat (limited to 'clang/lib/AST/ExprCXX.cpp')
-rw-r--r-- | clang/lib/AST/ExprCXX.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/AST/ExprCXX.cpp b/clang/lib/AST/ExprCXX.cpp index 31bf432cf9f..c127b4a1dc0 100644 --- a/clang/lib/AST/ExprCXX.cpp +++ b/clang/lib/AST/ExprCXX.cpp @@ -68,6 +68,11 @@ const UuidAttr *CXXUuidofExpr::GetUuidAttrOfType(QualType QT, if (!RD) return nullptr; + // Loop over all record redeclarations looking for a uuid attribute. + for (const TagDecl *I : RD->redecls()) + if (const UuidAttr *Uuid = I->getAttr<UuidAttr>()) + return Uuid; + // __uuidof can grab UUIDs from template arguments. if (ClassTemplateSpecializationDecl *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(RD)) { @@ -106,11 +111,6 @@ const UuidAttr *CXXUuidofExpr::GetUuidAttrOfType(QualType QT, return UuidForRD; } - // Loop over all record redeclarations looking for a uuid attribute. - for (const TagDecl *I : RD->redecls()) - if (const UuidAttr *Uuid = I->getAttr<UuidAttr>()) - return Uuid; - return nullptr; } |