diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2012-12-21 21:43:05 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-12-21 21:43:05 +0000 |
| commit | 7a16a02eec1c536b5598423e810b9dae05819f35 (patch) | |
| tree | 42c562ceb96e0e63f2dd03f67af2ec2421a107c2 /clang/lib | |
| parent | 5deaa4c9025daac004a879a9a1f44a715db9930c (diff) | |
| download | bcm5719-llvm-7a16a02eec1c536b5598423e810b9dae05819f35.tar.gz bcm5719-llvm-7a16a02eec1c536b5598423e810b9dae05819f35.zip | |
Fixes couple of friend declaration -ast-print bug
found by running -ast-print on all-std-headers.cpp
which caused it to go into infinite loop. Now
-ast-print prints all declarations found in
all-std-headers.cpp.
llvm-svn: 170928
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/DeclPrinter.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp index 4a7344c9828..b4005221f47 100644 --- a/clang/lib/AST/DeclPrinter.cpp +++ b/clang/lib/AST/DeclPrinter.cpp @@ -580,10 +580,8 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { void DeclPrinter::VisitFriendDecl(FriendDecl *D) { if (TypeSourceInfo *TSI = D->getFriendType()) { - if (CXXRecordDecl *FriendD = TSI->getType()->getAsCXXRecordDecl()) { - Out << "friend "; - VisitCXXRecordDecl(FriendD); - } + Out << "friend "; + Out << " " << TSI->getType().getAsString(Policy); } else if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D->getFriendDecl())) { @@ -598,7 +596,7 @@ void DeclPrinter::VisitFriendDecl(FriendDecl *D) { else if (ClassTemplateDecl *CTD = dyn_cast<ClassTemplateDecl>(D->getFriendDecl())) { Out << "friend "; - VisitClassTemplateDecl(CTD); + VisitRedeclarableTemplateDecl(CTD); } } |

