summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-02-21 23:18:00 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-02-21 23:18:00 +0000
commit27e39b11b18c5805d72de998ab585bed86527d79 (patch)
tree3d9259fbeb6e0a95a4432d1b1282f12618f0ad79 /clang/lib/Sema
parent13adc7fefdd8b9031e28a008be7385f27d08ad05 (diff)
downloadbcm5719-llvm-27e39b11b18c5805d72de998ab585bed86527d79.tar.gz
bcm5719-llvm-27e39b11b18c5805d72de998ab585bed86527d79.zip
C++0x's deduced auto is illegal in typedefs.
This actually rules out too much, since it also catches typedefs for pointers to functions with trailing return types: typedef auto (*F)() -> int; Fix for that (and the same issue in all abstract-declarators) to follow shortly. llvm-svn: 126153
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaType.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index c88baa540f5..8051b560343 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -1483,7 +1483,7 @@ TypeSourceInfo *Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
break;
case Declarator::TypeNameContext:
if (!AutoAllowedInTypeName)
- Error = 8; // Generic
+ Error = 9; // Generic
break;
case Declarator::FileContext:
case Declarator::BlockContext:
@@ -1492,6 +1492,9 @@ TypeSourceInfo *Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
break;
}
+ if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_typedef)
+ Error = 8;
+
if (Error != -1) {
Diag(D.getDeclSpec().getTypeSpecTypeLoc(), diag::err_auto_not_allowed)
<< Error;
OpenPOWER on IntegriCloud