aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaCXXScopeSpec.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-07-22 00:28:09 +0000
committerDouglas Gregor <dgregor@apple.com>2009-07-22 00:28:09 +0000
commit7551c183e8d788b5254e9c6f8bd8d719cea47da8 (patch)
tree607a1d0e749ecc11ec643fad10271c12ed97a159 /lib/Sema/SemaCXXScopeSpec.cpp
parentf59a56e180bf54528d7d1d5afa68fcc13300965a (diff)
Complain if we're entering the context of a dependent nested-name-specifier but
cannot match that nested-name-specifier to a class template or class template partial specialization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76704 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCXXScopeSpec.cpp')
-rw-r--r--lib/Sema/SemaCXXScopeSpec.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/Sema/SemaCXXScopeSpec.cpp b/lib/Sema/SemaCXXScopeSpec.cpp
index 7db0da4553..cf73725e7f 100644
--- a/lib/Sema/SemaCXXScopeSpec.cpp
+++ b/lib/Sema/SemaCXXScopeSpec.cpp
@@ -17,6 +17,7 @@
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/Parse/DeclSpec.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/raw_ostream.h"
using namespace clang;
/// \brief Compute the DeclContext that is associated with the given
@@ -48,7 +49,7 @@ DeclContext *Sema::computeDeclContext(const CXXScopeSpec &SS,
if (EnteringContext) {
// We are entering the context of the nested name specifier, so try to
// match the nested name specifier to either a primary class template
- // or a class template partial specialization
+ // or a class template partial specialization.
if (const TemplateSpecializationType *SpecType
= dyn_cast_or_null<TemplateSpecializationType>(NNS->getAsType())) {
if (ClassTemplateDecl *ClassTemplate
@@ -64,6 +65,17 @@ DeclContext *Sema::computeDeclContext(const CXXScopeSpec &SS,
// FIXME: Class template partial specializations
}
}
+
+ std::string NNSString;
+ {
+ llvm::raw_string_ostream OS(NNSString);
+ NNS->print(OS, Context.PrintingPolicy);
+ }
+
+ // FIXME: Allow us to pass a nested-name-specifier to Diag?
+ Diag(SS.getRange().getBegin(),
+ diag::err_template_qualified_declarator_no_match)
+ << NNSString << SS.getRange();
}
return 0;