Revision 9d2cca71cf54ddfebda26e247d82ae7b71d9e03c authored by Pranav Gokhale on 30 June 2018, 18:56:21 UTC, committed by Pranav Gokhale on 30 June 2018, 18:56:21 UTC
1 parent 720b0db
Raw File
cxx0x-constexpr-const.cpp
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s

constexpr int x = 1;
constexpr int id(int x) { return x; }

void foo(void) {
  x = 2; // expected-error {{read-only variable is not assignable}}
  int (*idp)(int) = id;
}

back to top