From 645526c3e42170e356f792b1bc0ac2acb65c26c4 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Wed, 23 Oct 2013 21:31:20 +0000 Subject: 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 --- test/Parser/DelayedTemplateParsing.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') 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 +constexpr T Fun(T A) { return T(0); } + +constexpr int Var = Fun(20); +} + -- cgit v1.2.1