aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-02-01 04:40:02 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-02-01 04:40:02 +0000
commit8398cbfc73f7ff0a676232db9ea9160bb9dafd8d (patch)
tree393e5bf85ad28286a64934f7a5b7afb7067bc5eb /lib/Sema/SemaType.cpp
parentb04035a7b1a3c9b93cea72ae56dd2ea6e787bae9 (diff)
constexpr: Unlike other incomplete types, 'void' cannot possibly be completed as
a literal type. Disallow it as the return type of a constexpr function declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 280a60e5de..684f355bfb 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -4212,7 +4212,8 @@ bool Sema::RequireLiteralType(SourceLocation Loc, QualType T,
assert(!T->isDependentType() && "type should not be dependent");
bool Incomplete = RequireCompleteType(Loc, T, 0);
- if (T->isLiteralType() || (AllowIncompleteType && Incomplete))
+ if (T->isLiteralType() ||
+ (AllowIncompleteType && Incomplete && !T->isVoidType()))
return false;
if (PD.getDiagID() == 0)