diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-10-13 18:05:20 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-10-13 18:05:20 +0000 |
commit | db4d4bb03df52920cf379797a7ff5c9900f938a6 (patch) | |
tree | 03b7cdd417efc181b83b5a850d9ff33561bee530 /lib/Sema/SemaTemplate.cpp | |
parent | b535041ee33c5eff255832bc5541c8d52aae8254 (diff) |
Introduce a bit into Type that keeps track of whether there are any
unnamed or local types within that type. This bit is cached along with
the linkage of a type, so that it can be recomputed (e.g., when we see
that a typedef has given a name to an anonymous declaration).
Use this bit when checking C++03 [temp.arg.type]p2, so that we don't
walk template argument types repeatedly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116413 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 3b2ca1e162..f85c3f0070 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -2582,7 +2582,7 @@ bool Sema::CheckTemplateArgument(TemplateTypeParmDecl *Param, // // C++0x allows these, and even in C++03 we allow them as an extension with // a warning. - if (!LangOpts.CPlusPlus0x) { + if (!LangOpts.CPlusPlus0x && Arg->hasUnnamedOrLocalType()) { UnnamedLocalNoLinkageFinder Finder(*this, SR); (void)Finder.Visit(Context.getCanonicalType(Arg)); } |