aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-10-01 20:35:07 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-10-01 20:35:07 +0000
commitc4a839101e883261d038a1d5ea718dd46abd1d2d (patch)
treeda1a42024f66928c8de0c835dda535f4274f51d2 /lib/Sema/SemaDecl.cpp
parentbbff82f302a1dd67589f65912351978905f0c5a7 (diff)
PR13978: A 'decltype' DeclSpec has an expression representation, not a type
representation. Fix crash if it appears in the return type of a member function definition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164967 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 593c110c8a..4382432a6f 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3400,7 +3400,6 @@ static bool RebuildDeclaratorInCurrentInstantiation(Sema &S, Declarator &D,
switch (DS.getTypeSpecType()) {
case DeclSpec::TST_typename:
case DeclSpec::TST_typeofType:
- case DeclSpec::TST_decltype:
case DeclSpec::TST_underlyingType:
case DeclSpec::TST_atomic: {
// Grab the type from the parser.
@@ -3424,6 +3423,7 @@ static bool RebuildDeclaratorInCurrentInstantiation(Sema &S, Declarator &D,
break;
}
+ case DeclSpec::TST_decltype:
case DeclSpec::TST_typeofExpr: {
Expr *E = DS.getRepAsExpr();
ExprResult Result = S.RebuildExprInCurrentInstantiation(E);