https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81853

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-02-16
                 CC|                            |msebor at gcc dot gnu.org
      Known to work|                            |4.5.4
            Summary|[C++14] "using namespace"   |[ 6/7/8 Regression] "using
                   |is not a constant           |namespace" is not a
                   |expression in function-like |constant expression in a
                   |macro                       |statement expression
     Ever confirmed|0                           |1
      Known to fail|                            |4.6.4, 4.7.4, 4.8.4, 4.9.4,
                   |                            |5.5.0, 6.4.0, 7.2.0, 8.0

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed with the simplified test case below.  GCC 4.5 compiles the test case
without a complaint so the failure is a regression introduced in r166167.

$ cat t.C && gcc -S -Wall -Wextra -Wpedantic t.C
namespace N {
  enum { i };
}

int g ()
{
  constexpr int j = ({ using namespace N; i; });
  return j;
}
t.C: In function ‘int g()’:
t.C:7:21: warning: ISO C++ forbids braced-groups within expressions
[-Wpedantic]
   constexpr int j = ({ using namespace N; i; });
                     ^
t.C:7:40: error: statement is not a constant expression
   constexpr int j = ({ using namespace N; i; });
                                        ^

Reply via email to