diff options
author | David Majnemer <david.majnemer@gmail.com> | 2013-12-05 01:36:53 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2013-12-05 01:36:53 +0000 |
commit | 3252fd0d5be322cd5172126c30ebdedf88f4ef4b (patch) | |
tree | bbb8ee4ec92fe39d7e9eecb4e55b8596439c8e40 /clang/lib/Sema/SemaInit.cpp | |
parent | 315133710d270db3486a583e1ed6f885dfff07b8 (diff) | |
download | bcm5719-llvm-3252fd0d5be322cd5172126c30ebdedf88f4ef4b.tar.gz bcm5719-llvm-3252fd0d5be322cd5172126c30ebdedf88f4ef4b.zip |
Parse: Recover better from bad definitions with base specifiers
We would skip until the next comma, hoping good things whould lie there,
however this would fail when we have such things as this:
struct A {};
template <typename>
struct D;
template <>
struct D<C> : B, A::D;
Once this happens, we would believe that D with a nested namespace
specifier of A was a variable that was being declared. We would go on
to complain that there was an extraneous 'template <>' on their variable
declaration.
Crashes would happen when 'A' gets defined as 'enum class A {}' as
various asserts would fire.
Instead, we should skip up until the semicolon if we see that we are in
the middle of a definition and the current token is a ':'
This fixes PR17084.
llvm-svn: 196453
Diffstat (limited to 'clang/lib/Sema/SemaInit.cpp')
0 files changed, 0 insertions, 0 deletions