diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-05-07 04:49:29 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-05-07 04:49:29 +0000 |
commit | 6d6eb57225b53fb627c565861d1d0e90645400d1 (patch) | |
tree | 78f85cfa25a37b468300c0bd09e59cf7e6e131e8 /lib/Sema/SemaType.cpp | |
parent | 84060dbbe5b06c26b25d0ba7107213479a2e0f8b (diff) |
Diagnose attempts to use C++ default arguments outside of a function declaration
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50799 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 33797c4255..85ff96111a 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -501,6 +501,10 @@ Sema::TypeResult Sema::ActOnTypeName(Scope *S, Declarator &D) { assert(!T.isNull() && "GetTypeForDeclarator() returned null type"); + // Check that there are no default arguments (C++ only). + if (getLangOptions().CPlusPlus) + CheckExtraCXXDefaultArguments(D); + // In this context, we *do not* check D.getInvalidType(). If the declarator // type was invalid, GetTypeForDeclarator() still returns a "valid" type, // though it will not reflect the user specified type. |