diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-09-02 23:58:38 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-09-02 23:58:38 +0000 |
| commit | 64792e021dc387832f74f566495e80df3c084d7f (patch) | |
| tree | 5b32057e328b5df15e1ca20238850ac41b669863 /clang/lib/AST/NestedNameSpecifier.cpp | |
| parent | fc39586b4f2c06a2debfb462b108c1e0d1f3c81c (diff) | |
| download | bcm5719-llvm-64792e021dc387832f74f566495e80df3c084d7f.tar.gz bcm5719-llvm-64792e021dc387832f74f566495e80df3c084d7f.zip | |
Add a wicked little test-case that illustrates what we have to deal
with to properly support member access expressions in templates. This
test is XFAIL'd, because we get it completely wrong, but I've made the
minimal changes to the representation to at least avoid a crash.
llvm-svn: 80856
Diffstat (limited to 'clang/lib/AST/NestedNameSpecifier.cpp')
| -rw-r--r-- | clang/lib/AST/NestedNameSpecifier.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/AST/NestedNameSpecifier.cpp b/clang/lib/AST/NestedNameSpecifier.cpp index 0376f9db6be..0c24c89b291 100644 --- a/clang/lib/AST/NestedNameSpecifier.cpp +++ b/clang/lib/AST/NestedNameSpecifier.cpp @@ -75,7 +75,17 @@ NestedNameSpecifier::Create(ASTContext &Context, NestedNameSpecifier *Prefix, Mockup.Specifier = T; return FindOrInsert(Context, Mockup); } - + +NestedNameSpecifier * +NestedNameSpecifier::Create(ASTContext &Context, IdentifierInfo *II) { + assert(II && "Identifier cannot be NULL"); + NestedNameSpecifier Mockup; + Mockup.Prefix.setPointer(0); + Mockup.Prefix.setInt(Identifier); + Mockup.Specifier = II; + return FindOrInsert(Context, Mockup); +} + NestedNameSpecifier *NestedNameSpecifier::GlobalSpecifier(ASTContext &Context) { if (!Context.GlobalNestedNameSpecifier) Context.GlobalNestedNameSpecifier = new (Context, 4) NestedNameSpecifier(); |

