* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-inline-1.C
blobfed699049124fc495b15b46974f330475d2f6103
1 // PR c++/53792 - [C++11] improving compiler-time constexpr evaluation
2 //     Test case from comment #8.
3 // { dg-do compile { target c++14 } }
4 // { dg-additional-options "-O1 -fdump-tree-optimized" }
6 template <class T>
7 void sink (T);
8   
9 constexpr unsigned foo ()
11   unsigned  i = 1;
12   while ((i << 1) > i)
13     i = i << 1;
15   return i;
18 template <unsigned N>
19 struct S { };
21 void bar ()
23   sink (foo ());
24   sink (S<foo ()>());
27 // Verify that the call to the foo() constexpr function is inlined
28 // regardless of whether or not it's invoked in a constant expression.
29 // { dg-final { scan-tree-dump-not "= *foo *\\\(" "optimized" } }