diff options
author | David Majnemer <david.majnemer@gmail.com> | 2013-10-23 21:31:20 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2013-10-23 21:31:20 +0000 |
commit | 645526c3e42170e356f792b1bc0ac2acb65c26c4 (patch) | |
tree | 36c76ceb92c36b5d434705aba4969859c28581c9 /test | |
parent | 885d8bf8d06ddaf79ffe45a96aaa42621db44241 (diff) | |
download | clang-645526c3e42170e356f792b1bc0ac2acb65c26c4.tar.gz |
Parse: Disable delayed template parsing for constexpr functions
Commit r191484 treated constexpr function templates as normal function
templates with respect to delaying their parsing. However, this is
unnecessarily restrictive because there is no compatibility concern with
constexpr, MSVC doesn't support it.
Instead, simply disable delayed template parsing for constexpr function
templates. This largely reverts the changes made in r191484 but keeps
it's unit test.
This fixes PR17661.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193274 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Parser/DelayedTemplateParsing.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Parser/DelayedTemplateParsing.cpp b/test/Parser/DelayedTemplateParsing.cpp index 201fe1b466..73128c49f2 100644 --- a/test/Parser/DelayedTemplateParsing.cpp +++ b/test/Parser/DelayedTemplateParsing.cpp @@ -114,3 +114,10 @@ void LLVMBuildStructGEP() { CreateConstInBoundsGEP2_32(); } } +namespace PR17661 { +template <typename T> +constexpr T Fun(T A) { return T(0); } + +constexpr int Var = Fun(20); +} + |