diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-01 21:51:26 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-01 21:51:26 +0000 |
commit | fe3d7d088063cdee3b6fc7eff83da868d289a67b (patch) | |
tree | d60ad76918e7902929b2308417255bb32f440d94 /clang/lib/Sema/SemaInherit.h | |
parent | 7182686dbfca9ee66a187e339438f1cf61346856 (diff) | |
download | bcm5719-llvm-fe3d7d088063cdee3b6fc7eff83da868d289a67b.tar.gz bcm5719-llvm-fe3d7d088063cdee3b6fc7eff83da868d289a67b.zip |
Make parsing a semantic analysis a little more robust following Sema
failures that involve malformed types, e.g., "typename X::foo" where
"foo" isn't a type, or "std::vector<void>" that doens't instantiate
properly.
Similarly, be a bit smarter in our handling of ambiguities that occur
in Sema::getTypeName, to eliminate duplicate error messages about
ambiguous name lookup.
This eliminates two XFAILs in test/SemaCXX, one of which was crying
out to us, trying to tell us that we were producing repeated error
messages.
llvm-svn: 68251
Diffstat (limited to 'clang/lib/Sema/SemaInherit.h')
-rw-r--r-- | clang/lib/Sema/SemaInherit.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaInherit.h b/clang/lib/Sema/SemaInherit.h index 6138685b264..20c8ae5e039 100644 --- a/clang/lib/Sema/SemaInherit.h +++ b/clang/lib/Sema/SemaInherit.h @@ -132,8 +132,16 @@ namespace clang { /// DetectedVirtual - The base class that is virtual. const RecordType *DetectedVirtual; + /// \brief Array of the declarations that have been found. This + /// array is constructed only if needed, e.g., to iterate over the + /// results within LookupResult. + NamedDecl **DeclsFound; + unsigned NumDeclsFound; + friend class Sema; + void ComputeDeclsFound(); + public: typedef std::list<BasePath>::const_iterator paths_iterator; @@ -143,15 +151,21 @@ namespace clang { bool RecordPaths = true, bool DetectVirtual = true) : FindAmbiguities(FindAmbiguities), RecordPaths(RecordPaths), - DetectVirtual(DetectVirtual), DetectedVirtual(0) + DetectVirtual(DetectVirtual), DetectedVirtual(0), DeclsFound(0), + NumDeclsFound(0) {} + ~BasePaths() { delete [] DeclsFound; } + paths_iterator begin() const { return Paths.begin(); } paths_iterator end() const { return Paths.end(); } BasePath& front() { return Paths.front(); } const BasePath& front() const { return Paths.front(); } + NamedDecl **found_decls_begin(); + NamedDecl **found_decls_end(); + bool isAmbiguous(QualType BaseType); /// isFindingAmbiguities - Whether we are finding multiple paths |