diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2013-10-22 04:14:18 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2013-10-22 04:14:18 +0000 |
| commit | 588a51a471b4cb23613e8183e05d2d193d2ab813 (patch) | |
| tree | 6694aba70d5968f2b4e245f4fa0b2bfd64f0c312 /lib/CodeGen/CGExpr.cpp | |
| parent | 2cfbf0552f90c7ef42975ca1b9064888550ca2ee (diff) | |
| download | clang-588a51a471b4cb23613e8183e05d2d193d2ab813.tar.gz clang-588a51a471b4cb23613e8183e05d2d193d2ab813.tar.bz2 clang-588a51a471b4cb23613e8183e05d2d193d2ab813.tar.xz | |
Sema: Do not allow template declarations inside local classes
Summary:
Enforce the rule in C++11 [temp.mem]p2 that local classes cannot have
member templates.
This fixes PR16947.
N.B. C++14 has slightly different wording to afford generic lambdas
declared inside of functions.
Fun fact: Some formulations of local classes with member templates
would cause clang to crash during Itanium mangling, such as the
following:
void outer_mem() {
struct Inner {
template <typename = void>
struct InnerTemplateClass {
static void itc_mem() {}
};
};
Inner::InnerTemplateClass<>::itc_mem();
}
Reviewers: eli.friedman, rsmith, doug.gregor, faisalv
Reviewed By: doug.gregor
CC: cfe-commits, ygao
Differential Revision: http://llvm-reviews.chandlerc.com/D1866
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193144 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
0 files changed, 0 insertions, 0 deletions
