From: Douglas Gregor Date: Wed, 2 Sep 2009 13:12:51 +0000 (+0000) Subject: Document how we intepret C++ DR 382 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de18d1264ea01234ca864606a8717272b2c7c5fb;p=clang Document how we intepret C++ DR 382 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80785 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 8566789ccd..f0165c91e1 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -3033,6 +3033,12 @@ Sema::CheckTypenameType(NestedNameSpecifier *NNS, const IdentifierInfo &II, // instantiation, then build a typename type. if (!CurrentInstantiation) return Context.getTypenameType(NNS, &II); + + // The nested-name-specifier refers to the current instantiation, so the + // "typename" keyword itself is superfluous. In C++03, the program is + // actually ill-formed. However, DR 382 (in C++0x CD1) allows such + // extraneous "typename" keywords, and we retroactively apply this DR to + // C++03 code. } DeclContext *Ctx = 0;