aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard@metafoo.co.uk>2020-09-24 18:07:05 -0700
committerRichard Smith <richard@metafoo.co.uk>2020-09-24 19:02:27 -0700
commit8c98c8803430804010da06a07cfb291dab59067c (patch)
tree7d41ccecd3d64cff0bce3d95fe4e8b0706b927c9 /clang/lib/Parse/ParseDecl.cpp
parent960535d65a927b27ff883250094492842c33ca86 (diff)
downloadllvm-8c98c8803430804010da06a07cfb291dab59067c.zip
llvm-8c98c8803430804010da06a07cfb291dab59067c.tar.gz
llvm-8c98c8803430804010da06a07cfb291dab59067c.tar.bz2
PR47176: Don't read from an inactive union member if a friend function
has default arguments and an exception specification.
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index d6b2eb8..79628cf 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -6486,6 +6486,10 @@ void Parser::ParseFunctionDeclarator(Declarator &D,
InitCXXThisScopeForDeclaratorIfRelevant(D, DS, ThisScope);
// Parse exception-specification[opt].
+ // FIXME: Per [class.mem]p6, all exception-specifications at class scope
+ // should be delayed, including those for non-members (eg, friend
+ // declarations). But only applying this to member declarations is
+ // consistent with what other implementations do.
bool Delayed = D.isFirstDeclarationOfMember() &&
D.isFunctionDeclaratorAFunctionDeclaration();
if (Delayed && Actions.isLibstdcxxEagerExceptionSpecHack(D) &&