[Question]
  [
According to <http://en.cppreference.com/w/cpp/language/integer_literal>, integer literals consist of a decimal/hex/octal/binary literal and a optional integer suffix, that is obviously completely unnecessary, wastes precious bytes and is not used in this challenge.
A decimal literal is `a non-zero decimal digit (1, 2, 3, 4, 5, 6, 7, 8, 9), followed by zero or more decimal digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)`.
A octal literal is `the digit zero (0) followed by zero or more octal digits (0, 1, 2, 3, 4, 5, 6, 7)`.
A hexadecimal literal is `the character sequence 0x or the character sequence 0X followed by one or more hexadecimal digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, A, b, B, c, C, d, D, e, E, f, F)` (note the case-insensitivity of `abcdefx`).
A binary literal is `the character sequence 0b or the character sequence 0B followed by one or more binary digits (0, 1)`.
Additionally, there may optionally be some `'`s as a digit separator. They have no meaning and can be ignored.
## Input
A string that represents a C++14 integer literal or an array of its charcodes.
## Output
The number represented by the input string in base 10, with an optional trailing newline. The correct output never will exceed 2\*10^9
## Winning criteria
[The GCC contributors need over 500 lines of code to do this,](https://github.com/gcc-mirror/gcc/blob/master/libcpp/expr.c#L506-L1011) therefore our code must be as short as possible! 
## Test cases:
```
0                       ->    0
1                       ->    1
12345                   ->    12345
12345'67890             ->    1234567890
0xFF                    ->    255
0XfF                    ->    255
0xAbCdEf                ->    11259375
0xa'bCd'eF              ->    11259375
0b1111'0000             ->    240
0b0                     ->    0
0B1'0                   ->    2
0b1                     ->    1
00                      ->    0
01                      ->    1
012345                  ->    5349
0'123'4'5               ->    5349
```
  
[Answer]
# x86 (32-bit) machine code, ~~59~~ 57 bytes
This function takes `esi` as a pointer to a null-terminated string and returns the value in `edx`. (Listing below is GAS input in AT&T syntax.)
```
        .globl parse_cxx14_int
        .text
parse_cxx14_int:
        push $10
        pop %ecx                # store 10 as base
        xor %eax,%eax           # initialize high bits of digit reader
        cdq                     # also initialize result accumulator edx to 0
        lodsb                   # fetch first character
        cmp $'0', %al
        jne .Lparseloop2
        lodsb
        and $~32, %al           # uppercase letters (and as side effect,
                                # digits are translated to N+16)
        jz .Lend                # "0" string
        cmp $'B', %al           # after '0' have either digit, apostrophe,
                                # 'b'/'B' or 'x'/'X'
        je .Lbin
        jg .Lhex
        dec %ecx
        dec %ecx                # update base to 8
        jmp .Lprocessdigit      # process octal digit that we just read (or
                                # skip ' if that is what we just read)   
.Lbin:
        sub $14, %ecx           # with below will update base to 2
.Lhex:
        add $6, %ecx            # update base to 16
.Lparseloop:
        lodsb                   # fetch next character
.Lparseloop2:
        and $~32, %al           # uppercase letters (and as side effect,
                                # digits are translated to N+16)
        jz .Lend
.Lprocessdigit:
        cmp $7, %al             # skip ' (ASCII 39 which would have been
                                # translated to 7 above)
        je .Lparseloop
        test $64, %al           # distinguish letters and numbers
        jz .Lnum
        sub $39, %al            # with below will subtract 55 so e.g. 'A'==65
                                # will become 10
.Lnum:
        sub $16, %al            # translate digits to numerical value
        imul %ecx, %edx
#        movzbl %al, %eax
        add %eax, %edx          # accum = accum * base + newdigit
        jmp .Lparseloop
.Lend:
        ret
```
And a disassembly with byte counts - in Intel format this time, in case you prefer that one.
```
Disassembly of section .text:
00000000 <parse_cxx14_int>:
   0:   6a 0a                   push   0xa
   2:   59                      pop    ecx
   3:   31 c0                   xor    eax,eax
   5:   99                      cdq    
   6:   ac                      lods   al,BYTE PTR ds:[esi]
   7:   3c 30                   cmp    al,0x30
   9:   75 16                   jne    21 <parse_cxx14_int+0x21>
   b:   ac                      lods   al,BYTE PTR ds:[esi]
   c:   24 df                   and    al,0xdf
   e:   74 28                   je     38 <parse_cxx14_int+0x38>
  10:   3c 42                   cmp    al,0x42
  12:   74 06                   je     1a <parse_cxx14_int+0x1a>
  14:   7f 07                   jg     1d <parse_cxx14_int+0x1d>
  16:   49                      dec    ecx
  17:   49                      dec    ecx
  18:   eb 0b                   jmp    25 <parse_cxx14_int+0x25>
  1a:   83 e9 0e                sub    ecx,0xe
  1d:   83 c1 06                add    ecx,0x6
  20:   ac                      lods   al,BYTE PTR ds:[esi]
  21:   24 df                   and    al,0xdf
  23:   74 13                   je     38 <parse_cxx14_int+0x38>
  25:   3c 07                   cmp    al,0x7
  27:   74 f7                   je     20 <parse_cxx14_int+0x20>
  29:   a8 40                   test   al,0x40
  2b:   74 02                   je     2f <parse_cxx14_int+0x2f>
  2d:   2c 27                   sub    al,0x27
  2f:   2c 10                   sub    al,0x10
  31:   0f af d1                imul   edx,ecx
  34:   01 c2                   add    edx,eax
  36:   eb e8                   jmp    20 <parse_cxx14_int+0x20>
  38:   c3                      ret    
```
And in case you want to try it, here is the C++ test driver code that I linked with it (including the calling convention specification in GCC asm syntax):
```
#include <cstdio>
#include <string>
#include <iostream>
inline int parse_cxx14_int_wrap(const char *s) {
    int result;
    const char* end;
    __asm__("call parse_cxx14_int" :
            "=d"(result), "=S"(end) :
            "1"(s) :
            "eax", "ecx", "cc");
    return result;
}
int main(int argc, char* argv[]) {
    std::string s;
    while (std::getline(std::cin, s))
        std::printf("%-16s -> %d\n", s.c_str(), parse_cxx14_int_wrap(s.c_str()));
    return 0;
}
```
---
-1 byte due to comment by Peter Cordes
-1 byte from updating to use two decrements to change 10 to 8
[Answer]
# [JavaScript (Babel Node)](https://babeljs.io/), 26 bytes
lol x2
```
_=>eval(_.split`'`.join``)
```
[Try it online!](https://tio.run/##ndJBD4IgGAbge7/CeUEPKqBmHmyrVr@hm4Ji0zFp2Zr/3qiDLYHc@k4cePa@46MlD9KXt@Z69yihjHudqNhYZ2OebdmDcCf3@ytv7gUo/FY0XVG4Yym6XnDmc3FxasdGtuta@gkCy9u@Dmg1RziMYj38oNcdLQTrZJPCOf@G7ytzDYfTyVB30jhWQuG5/osNO3qojrWGfroiHKdhorEESAyYGrxsKZIDoBzjG@FIfRwKTaucmIr2MmhhkVhTcDFJ@TLQ2O5XPbSM1CTz75xQHEap4oCEIAIa@uXGJw "JavaScript (Babel Node) – Try It Online")
[Answer]
# C++ (gcc), ~~141~~ ~~138~~ ~~134~~ 120 bytes
This is a function that takes an array of characters (specified as a pair of pointers to the start and end - using the pair of iterators idiom) and returns the number. Note that the function mutates the input array.
(This does rely on the behavior of gcc/libstdc++ that `#include<cstdlib>` also places the functions in global scope. For strictly standard compliant code, replace with `#include<stdlib.h>` for a cost of one more character.)
Brief description: The code first uses `std::remove` to filter out `'` characters (ASCII 39). Then, `strtol` with a base of 0 will already handle the decimal, octal, and hexadecimal cases, so the only other case to check for is a leading `0b` or `0B` and if so, set the base for `strtol` to 2 and start parsing after the leading 2 characters.
```
#import<algorithm>
#import<cstdlib>
int f(char*s,char*e){e=s[*std::remove(s,e,39)=1]&31^2?s:s+2;return strtol(e,0,e-s);}
```
[Try it online.](https://tio.run/##VU9/b4IwEP2/n6JxUairBtC5KeqyLfMzLHHOQCnQBApp64/E@NndFTRzl/T67vXu3Sur60HG2OXyIMq6UmYeFVmlhMnLJbpRTJukEPESCWlw6rI8Un1Nm4uTE1/odR86ZjPFy2rPXU05HU3Jwt/0Rv5P8Kpn@jEIFTc7JbE2ylSFy6lH@UCT8AyLJSt2CcdzEBHVMLeL/yglZHbPiAo4HpVXN9uDimq3Wd/2Yk3wCV@3pW6vr4cxz4R0CcW24DJxCQnxuZkvI3ixIFIZo7j5k8X79QZkEIb4px021CEXBcft1oybQkjeFkxICgZI02WjhjGTup3uwJ9oPFjibvItO9AzZFvQtKZuXwBTzdjVuheiM7r4yA9G46c2O5Pnl6mHvONqhbyvFNLxLf5IPtN7EDmAHA6PsQ/heBCA4bxDYVlkCcitsufA7YwdQIEP7C8)
---
Saved 3 bytes due to suggestion by ceilingcat and some more golfing that followed.
Saved 4 bytes due to suggestions by grastropner.
-2 bytes by Lucas
-12 bytes by l4m2
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 6 bytes
```
OxUr"'
```
---
```
OxUr"'  Full Program. Implicit Input U
  Ur"'  Remove ' from U
Ox      Eval as javascript
```
[Try it online!](https://tio.run/##y0osKPn/378itEhJ/f//aCVDJR0uJUMjYxNTOEPdzNzC0gDENahwcwPTEWkQusIxyTnFNQ3CTlQHctRTITJJhkCgbgAEEC6EcgIKQaXBFIQDYcMtNVAHMtVN1E2VYhV0c4MA "Japt – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 32 bytes
```
lambda a:eval(a.replace("'",""))
```
[Try it online!](https://tio.run/##hZHNasMwDMfP9VMIX@xAGuwkXpdCCttYnmCHHQbDXh0aSDPjuGv39JnSXutMYCP7/9MHkvsNh@8hn9r6Y@r10ew16K390T3Xmbeu11@WU0ZTSpNkOh@63sKbP9ktWekUDNRw1I6PwWd4OpeC1@fPbnCnwJNsdH0XOF3vMJasvA2It1yj73w3BMAfzIGZxtH66xPqGlDhJpkk3Lf1br4lkXlRqrg@qzeGPWweKxFjriIRl6aJF8uVIuK9/Y@4PJmX/WsbaUjmqio2M6YZcsw2y5iRaEyg3atXYs9GLAwI9WcMj3c8V1gcsBCwnF8uL0hENnTTVVFWRDBkWMlUFPkD "Python 2 – Try It Online")
lol
(needs Python 2 because Python 3 changed octal literals to `0o(...)`).
[Answer]
# Perl 5 (-p), 14 bytes
```
y/'/_/;$_=eval
```
[TIO](https://tio.run/##K0gtyjH9/79SX10/Xt9aJd42tSwx5/9/Qy5DI2MTUwipbmZuYWnAZVDh5sZlEJEGJCock5xTXNOAjER1IEs9FSiWZAgE6gZAAGQDsROQAxLlAgkASYiBBupAWt1E3fRffkFJZn5e8X/dnAIA)
[Answer]
# [R](https://www.r-project.org/), ~~79~~ ~~71~~ 69 bytes
```
`+`=strtoi;s=gsub("'","",scan(,""));na.omit(c(+s,sub("..",0,s)+2))[1]
```
[Try it online!](https://tio.run/##K/r/P0E7wba4pKgkP9O62Da9uDRJQ0ldSUdJSac4OTFPA8jQ1LTOS9TLz80s0UjW0C7WASvR01PSMdAp1tQ20tSMNoz9b5BkaGD4HwA "R – Try It Online")
`strtoi` does everything except for the base 2 conversions and ignoring the `'`, so there's quite a lot of bytes just to fix those things.
*Thanks to [Aaron Hayman](https://codegolf.stackexchange.com/users/85453/aaron-hayman) for -6 bytes, and inspiring -4 more bytes (and counting!)*
[Verify all test cases (old version)](https://tio.run/##NYzBCsIwEETv@YxcNgtRNrW1inqwYr/Ba6KNFKRCt0IO/nvcUpzD7NuBmTFnPj35E4wGbbW2fPeDEUA89LF7cWd6Xg/epOOKp3F694YR7R/nHoVvs1TRFmgTZqdcsSmrxWFb7/akKLWtolsUS@dweVyjgAch6CQLTgQkUtQIzImaH/FljEAulFDlHw)
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~16~~ 14 bytes
Saved 2 bytes thanks to *Grimy*
```
''KlÐïK>i8ö}.E
```
[Try it online!](https://tio.run/##yy9OTMpM/f9fXd075/CEw@u97TItDm@r1XP9/9@gIlE9yTlFPdUNAA "05AB1E – Try It Online")
or as a [Test Suite](https://tio.run/##yy9OTMpM/V/jouekpKBrp6B0aHXxua3/1dW9cw5POLze2y7T4vC2Wj3X/7WPGmYd3uF1aPd/Qy5DI2MTUwipbmZuYWnAZVDh5sZlEJEGJCock5xTXNOAjER1IEs9FSiWZAgE6gZAAGQDsROQAxLlAgkASYiBBupAWt1E3RQA)
**Explanation**
```
''K                # remove "'" from input
   l               # and convert to lower-case
    Ð              # triplicate
     ï             # convert one copy to integer
      K            # and remove it from the second copy
       >i  }       # if the result is 0
         8ö        # convert from base-8 to base-10
            .E     # eval
```
[Answer]
# Excel, 115 bytes
```
=DECIMAL(SUBSTITUTE(REPLACE(A1,2,1,IFERROR(VALUE(MID(A1,2,1)),)),"'",),VLOOKUP(A1,{"0",8;"0B",2;"0X",16;"1",10},2))
```
Input from A1, output to wherever you put this formula. Array formula, so use `Ctrl`+`Shift`+`Enter` to enter it.
I added a couple test cases you can see in the image - some early attempts handled all given test cases correctly but got rows 16 and/or 17 wrong.
[![enter image description here](https://i.stack.imgur.com/h7QwM.png)](https://i.stack.imgur.com/h7QwM.png)
[Answer]
# x86-64 machine code, 44 bytes
(The same machine code works in 32-bit mode as well.)
[@Daniel Schepler's answer](https://codegolf.stackexchange.com/questions/185642/parse-a-c14-integer-literal/185698#185698) was a starting point for this, but this has at least one new algorithmic idea (not just better golfing of the same idea): **The ASCII codes for `'B'` (`1000010`) and `'X'` (`1011000`) give 16 and 2 after masking with `0b0010010`**.
So after excluding decimal (non-zero leading digit) and octal (char after `'0'` is less than `'B'`), we can just set base = `c & 0b0010010` and jump into the digit loop.
Callable with x86-64 System V as `unsigned __int128 parse_cxx14_int(int dummy, const char*rsi);` Extract the EDX return value from the high half of the `unsigned __int128` result with `tmp>>64`.
```
        .globl parse_cxx14_int
## Input: pointer to 0-terminated string in RSI
## output: integer in EDX
## clobbers: RAX, RCX (base), RSI (points to terminator on return)
parse_cxx14_int:
        xor %eax,%eax           # initialize high bits of digit reader
        cdq                     # also initialize result accumulator edx to 0
        lea 10(%rax), %ecx      # base 10 default
        lodsb                   # fetch first character
        cmp $'0', %al
        jne .Lentry2
    # leading zero.  Legal 2nd characters are b/B (base 2), x/X (base 16)
    # Or NUL terminator = 0 in base 10
    # or any digit or ' separator (octal).  These have ASCII codes below the alphabetic ranges
    lodsb
    mov    $8, %cl              # after '0' have either digit, apostrophe, or terminator,
    cmp    $'B', %al            # or 'b'/'B' or 'x'/'X'  (set a new base)
    jb   .Lentry2               # enter the parse loop with base=8 and an already-loaded character
         # else hex or binary. The bit patterns for those letters are very convenient
    and    $0b0010010, %al      # b/B -> 2,   x/X -> 16
    xchg   %eax, %ecx
    jmp  .Lentry
.Lprocessdigit:
    sub  $'0' & (~32), %al
    jb   .Lentry                 # chars below '0' are treated as a separator, including '
    cmp  $10, %al
    jb  .Lnum
    add  $('0'&~32) - 'A' + 10, %al   # digit value = c-'A' + 10.  we have al = c - '0'&~32.
                                        # c = al + '0'&~32.  val = m+'0'&~32 - 'A' + 10
.Lnum:
        imul %ecx, %edx
        add %eax, %edx          # accum = accum * base + newdigit
.Lentry:
        lodsb                   # fetch next character
.Lentry2:
        and $~32, %al           # uppercase letters (and as side effect,
                                # digits are translated to N+16)
        jnz .Lprocessdigit      # space also counts as a terminator
.Lend:
        ret
```
The changed blocks vs. Daniel's version are (mostly) indented less than other instruction. Also the main loop has its conditional branch at the bottom. This turned out to be a neutral change because neither path could fall into the top of it, and the `dec ecx / loop .Lentry` idea for entering the loop turned out not to be a win after handling octal differently. But it has fewer instructions inside the loop with the loop in idiomatic form do{}while structure, so I kept it.
Daniel's C++ test harness works unchanged in 64-bit mode with this code, which uses the same calling convention as his 32-bit answer. 
```
g++ -Og parse-cxx14.cpp parse-cxx14.s &&
./a.out < tests | diff -u -w - tests.good
```
Disassembly, including the machine code bytes that are the actual answer
```
0000000000000000 <parse_cxx14_int>:
   0:   31 c0                   xor    %eax,%eax
   2:   99                      cltd   
   3:   8d 48 0a                lea    0xa(%rax),%ecx
   6:   ac                      lods   %ds:(%rsi),%al
   7:   3c 30                   cmp    $0x30,%al
   9:   75 1c                   jne    27 <parse_cxx14_int+0x27>
   b:   ac                      lods   %ds:(%rsi),%al
   c:   b1 08                   mov    $0x8,%cl
   e:   3c 42                   cmp    $0x42,%al
  10:   72 15                   jb     27 <parse_cxx14_int+0x27>
  12:   24 12                   and    $0x12,%al
  14:   91                      xchg   %eax,%ecx
  15:   eb 0f                   jmp    26 <parse_cxx14_int+0x26>
  17:   2c 10                   sub    $0x10,%al
  19:   72 0b                   jb     26 <parse_cxx14_int+0x26>
  1b:   3c 0a                   cmp    $0xa,%al
  1d:   72 02                   jb     21 <parse_cxx14_int+0x21>
  1f:   04 d9                   add    $0xd9,%al
  21:   0f af d1                imul   %ecx,%edx
  24:   01 c2                   add    %eax,%edx
  26:   ac                      lods   %ds:(%rsi),%al
  27:   24 df                   and    $0xdf,%al
  29:   75 ec                   jne    17 <parse_cxx14_int+0x17>
  2b:   c3                      retq   
```
Other changes from Daniel's version include saving the `sub $16, %al` from inside the digit-loop, by using more `sub` instead of `test` as part of detecting separators, and digits vs. alphabetic characters.
Unlike Daniel's *every* character below `'0'` is treated as a separator, not just `'\''`. (Except `' '`: `and $~32, %al` / `jnz` in both our loops treats space as a terminator, which is possibly convenient for testing with an integer at the start of a line.)
Every operation that modifies `%al` inside the loop has a branch consuming flags set by the result, and each branch goes (or falls through) to a different location.
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), 96 bytes
```
T`'L`_l
\B
:
^
a;
a;0:x:
g;
a;0:b:
2;
a;0:
8;
[a-g]
1$&
T`l`d
+`;(\d+):(\d+)
;$.($`*$1*_$2*
.+;
```
[Try it online!](https://tio.run/##JYw9D4IwEIb393dUixBJi6DYTmLExdHBRJSW8BET4mAc@Pf1sJe75557h/t039fbSrcIzsZdDb@YekRVQOEJq6mFmhQGb41C4g25xt2uhwckW@JqRtMiMjqo2mil/oRmccBMyGRYsyREHGk4JyGTTZp58u0u3wuIqSwhbj1hOjTH9tSTWE7GO8oaScUFFTlNQcecYg6I/qHgtHnKsx8 "Retina – Try It Online") Link includes test suite. Explanation:
```
T`'L`_l
```
Delete `'`s and convert everything to lower case.
```
\B
:
```
Separate the digits, as any hex digits need to be converted into decimal.
```
^
a;
a;0:x:
g;
a;0:b:
2;
a;0:
8;
```
Identify the base of the number.
```
[a-g]
1$&
T`l`d
```
Convert the characters `a-g` into numbers `10-16`.
```
+`;(\d+):(\d+)
;$.($`*$1*_$2*
```
Perform base conversion on the list of digits. `$.($`*$1*_*$2*` is short for `$.($`*$1*_*$2*_)` which multiplies `$`` and `$1` together and adds `$2`. (`$`` is the part of the string before the `;` i.e. the base.)
```
.+;
```
Delete the base.
[Answer]
# [J](http://jsoftware.com/), 48 bytes
```
cut@'0x 16b +0b 2b +0 8b0 '''do@rplc~'+',tolower
```
[Try it online!](https://tio.run/##JYxBC4JAEIXv@ysGL5O4yKypmWBYkad@QOfVXSKEDbGyQ/31bcwH8703M/BuvnOAtopRwqckKMm3j7FGmkDlGiLSkMwGhSZAxM7Vw71vvxihHF3vXmbwoTDt1a12MkZgVYAyUBCUtQXzNMM7BODOcwNzvVBCJes0W4j5ptiSoKlpBF0sY9rrY3eyHEgTf7RiIdE/8xx4ma@CyVi6CNkxxUyE/gc)
Eval after string substitution.
```
0XfF -> +16bff -> 255
0xa'bCd'eF -> +16babcdef -> 11259375
0B1'0 -> +2b10 -> 2
0 -> 8b0 -> 0
01 -> 8b01 -> 1
0'123'4'5 -> 8b012345 -> 5349
```
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 29 bytes
```
{+lc S/^0)>\d/0o/}o{S:g/\'//}
```
[Try it online!](https://tio.run/##hZGxCsIwGIRn8xSZjEU0f9pGrWBBxb6Ai2AVrG1EqEbaQaX02WOiaxNvyHJfuOO/R1GVE3V7477AC9UMyzPe0iN4cZpTkLSVzXZ@oSmhtFVCVri83os6jsdPWeU1blCvPr2xGIz3cPBQqwB3axSbFxBz@gwxPwi53TfujyGT6SwCG/M1EbySxB7mc45gJ/4Rr2W2zjfCUoj5PAqmBjsRzZEicWMZ0yKg1ZUX6s4ZOA8IK/3d3tgkOA8M4B4ImHsgsCz083kQRgiIZkhIuBX5AA "Perl 6 – Try It Online")
Perl 6 requires an explicit `0o` prefix for octal and doesn't support uppercase prefixes like `0X`.
### Explanation
```
                   {S:g/\'//}  # remove apostrophes
{                }o  # combine with function
     S/^0)>\d/0o/    # 0o prefix for octal
  lc  # lowercase
 +    # convert to number
```
[Answer]
# [Octave](https://www.gnu.org/software/octave/), ~~29~~ ~~21~~ 20 bytes
```
@(x)str2num(x(x>39))
```
[Try it online!](https://tio.run/##y08uSSxL/Z@mYKugp6f330GjQrO4pMgorzRXo0Kjws7YUlPzf5qGkkGFemKiqZLmfwA "Octave – Try It Online")
-8 bytes thanks to @TomCarpenter
[Answer]
# Bash, 33 bytes
```
x=${1//\'};echo $[${x/#0[Bb]/2#}]
```
[TIO](https://tio.run/##JYzNCsIwEITveYqFBlZPSWrrD8WDFfsMQuyhsQkVggU9GEj77HFLB3bm2zmM6b5DcpttTOHMoxLigXNln8MIXPMYRCZ1bVqRZ3ObZvYbXt7Cx3Y9eJgmDdxDW/UjOCLKt02KqXxXlKvj/nA8SSZD0zB5d2ThYq79zRF0SISWOqNIKEnEdDU9S8uWgnwdlEiJBZZ/)
# Zsh, ~~29~~ 27 bytes
-2 bytes thanks to @GammaFunction
```
<<<$[${${1//\'}/#0[Bb]/2#}]
```
[TIO](https://tio.run/##JYxBCsIwFET3OUWgga@rJLW1it1YsWcQYhctSahQFHRhMe3Z45QO/Jn3ZzG/Tx/9ZhtiWZbCiCCClvJOs0yUqbpGpsncxJl9@8fg@Nu1lg98mgwXA29O9sU9CPl0UTOd7rJ8ddoXh6Niaqxrpm4eNp67i716QEsgcug6DZGCwLgKz9KypYCvg4qQlFH@Bw)
[Answer]
# Go, 75
```
import "strconv"
func(i string)int64{n,_:=strconv.ParseInt(i,0,0);return n}
```
[Answer]
# JavaScript (ES6), 112 bytes
```
n=>+(n=n.toLowerCase().replace(/'/g,""))?n[1]=="b"?parseInt(n.substr(2),2):parseInt(n,+n[0]?10:n[1]=="x"?16:8):0
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 27 bytes
```
ØDiⱮḢ=1aƲȦ
ṣ”';/Ḋ⁾0o;Ɗ¹Ç?ŒV
```
[Try it online!](https://tio.run/##y0rNyan8///wDJfMRxvXPdyxyNYw8dimE8u4Hu5c/Khhrrq1/sMdXY8a9xnkWx/rOrTzcLv90Ulh/60fNcxR0LVTAKqwPtzO9XD3lsPtj5rWRP7/b8hlaGRsYgoh1c3MLSwNuAwq3Ny4DCLSgESFY5JzimsakJGoDmSppwLFkgyBQN0ACIBsIHYCckCiXCABIAkx0EAdSKubqJsCAA "Jelly – Try It Online")
Almost all of this is handling octal. Feels like it could be better golfed. 
[Answer]
# [Ruby](https://www.ruby-lang.org/) with `-n`, 17 bytes
Just jumping on the `eval` train, really.
```
p eval gsub(?'){}
```
[Try it online!](https://tio.run/##KypNqvz/v0AhtSwxRyG9uDRJw15ds7r2/38DQyNjLhA2qACS//ILSjLz84r/6@YBAA "Ruby – Try It Online")
[Answer]
# [Java (JDK)](http://jdk.java.net/), 101 bytes
```
n->{n=n.replace("'","");return n.matches("0[bB].+")?Long.parseLong(n.substring(2),2):Long.decode(n);}
```
[Try it online!](https://tio.run/##LY8xa8MwEIV3/wqhpRJNhOylIJOWBOqpWzoUQoaLLDVybMlIciAY/3ZVMb3pwb373rsO7rDt2lsyNiqvQSrUzEXv7C/S5Bi9ycLSuggRopHo7kyLBjD2f3c6A52LBuldstv32e4s82rsM4bgF7zBmNZexclbZNkAUV5VIJifLocze8X04yvnsBF8UE9FLAvTJaxgUtFNRcVqaJV0rSK5xpLqosuN2RRNz/bewyOwfKBgIEBzwvjtVpIWQlOmnf8EeSXHR4hqYG6KQoyZHvvnS8uSEj@UeVJZvSVe8sR/dPMH "Java (JDK) – Try It Online")
[`Long.decode`](https://docs.oracle.com/javase/7/docs/api/java/lang/Long.html#decode(java.lang.String)) deals with all kinds of literals except the binary ones.
Template borrowed from [Benjamin's answer](https://codegolf.stackexchange.com/a/185699/71546)
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~120~~ 118 bytes
-1 byte thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)
```
f(char*s){int r=0,c=s[1]&31,b=10;for(s+=2*(*s<49&&(b=c^24?c^2?8:2:16)-8);c=*s++;)r=c^39?r*b+(c>57?c%32+9:c-48):r;c=r;}
```
[Try it online!](https://tio.run/##VU7baoMwGL6eTxEETeIBkpi2HpbKVtZnGOwAGhfnxexIxigUn92lXpj1uwjfKfyfTHsp51kh@dnoyODLMP4ALUgihXmhb2FGk1ZQUqmTRiYWLEKRuedFGKJWyHfGa/vUeclKusVpjispIhPHFdY2zYpaR22M5H6zq2WQsbgoZcpzXGrb09U0/56GDvTLbWCPexfv7lvbBQr5Qcq4SffAIuheRz8BJgEKGYwrb/K868yvZhjR8qlHPvFtcCV0JSzjmxsBt7u8WIvkfDyu/Fk5fn5oD92TcrqB1oAfrtFSC0gsnOXoo43@VVfqTOfdjCTQSsjhYkzzHw "C (gcc) – Try It Online")
[Answer]
## C (gcc), ~~101~~ ~~97~~ 83 bytes
```
*d;*s;n;f(int*i){for(s=d=i;*d=*s;d+=*s++>39);i=wcstol(i+n,0,n=!i[1]||i[1]&29?0:2);}
```
[Try it online](https://tio.run/##ZZHRToMwFIav5SkqyWxLWdKyTcWmGmfkag9gMrnYqJgmk5HBosm2Z8dTAobif3Gg3/nPn8LJpp9Z1jSBlkElC5kTU9SBoad8fyCV0srIQCtoaQaVscdZTKVR31lV73fEsCLkYaGuzVqk57OtN1H8xB8iKi/N18YUhKKTh0A2Fkp5rNcpUh20WvnCD9FAAKLZfNHD7ohv7@5j3sGVz3@SxA8HIfwtTwY51vG8fdGveQtHxz/LBgPEH6OopQBhDrJuAFvujC2h6dzZWoSb8c8g3Ns539gxDBDP8cJNisRodDjFW@dFtg/YGbL7Q0Zx2f1sk8IbY9S7Kg/Qyok/mYpoV8EOJvq9gKzeF6KcwF71sSQ9opRK79L8Ag)
[Answer]
**PHP - 43 Byte**
```
eval("return ".str_replace($a,"'","").";");
```
Same method as <https://codegolf.stackexchange.com/a/185644/45489>
[Answer]
# C++, G++, 189 bytes
```
#include<fstream>
#include<string>
void v(std::string s){{std::ofstream a("a.cpp");a<<"#include<iostream>\nint main(){std::cout<<"<<s<<";}";}system("g++ -std=c++14 a.cpp");system("a.exe");}
```
No need for tests
Requires installation of `g++` with C++14 support
Now, explanations :
> 
>  It writes a file called `a.cpp`, uses GCC to compile it and gives a file that output the number
> 
> 
> 
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 27 bytes
```
Jscz\'?&qhJ\0}@J1r\0\7iJ8vJ
```
[Try it online!](http://pythtemp.herokuapp.com/?code=Jscz%5C%27%3F%26qhJ%5C0%7D%40J1r%5C0%5C7iJ8vJ&input=123&debug=0)
Unlike the previous (now deleted) Pyth answer, this one passes all test cases in the question, though it is 3 bytes longer.
[Answer]
# C (gcc) / Bash / C++, 118 bytes
```
f(i){asprintf(&i,"echo \"#import<iostream>\nmain(){std::cout<<%s;}\">i.C;g++ i.C;./a.out",i);fgets(i,i,popen(i,"r"));}
```
[Try it online!](https://tio.run/##LU5BboMwELz7FZYrahwIBQJpiWmkJmreUKn04DiY@ABGmKJIiLfTJelIOzM7ttcr15WU86xczUZh2043vXKftU9KeTW4IE@6bk3X59rYvitFvS@aWujGZaPtL7udNL99njuWTwXZ6@DIK8/DiwYvIoAz4mvGVVX21tW@9lvTlg040hHG@DTLq@jw8J1lPxzBz/gxGo8IA5TpXH5/OjDO7hHgf0XirKPY4nfs2KIh/uAruMU4muYIRfEmSR9Mt69vWYjC2@mEwi8FdPs4Hy@fCoyg4GgJ2TkC0BAAHuoAzZKiJQB@DAwpKE1oijZesopRnG5XUH8 "C (gcc) – Try It Online")
[Answer]
# Java, ~~158~~ 154 bytes
This just waiting to be outgolfed. Just tries regexes until something works and default to hex. 
  
-4 bytes thanks to @ValueInk
```
n->{n=n.replace("'","");var s=n.split("[bBxX]");return Long.parseLong(s[s.length-1],n.matches("0[bB].+")?2:n.matches("0\\d+")?8:n.matches("\\d+")?10:16);}
```
[Try it online](https://tio.run/##TZAxa8MwEIV3/wqhpRJNhJShLTZpaaCZuqVDIPFwdaRYri0b6Rwagn@7qpQMuenxHe8e7xo4wbw5/ETrUHsDlSbrS9b27kgM26C3STheZAEBbUVOvT2QDqy77XYl8Eu2JmYZ3fz14pZOeD206QyjD3RGKS9O4ElIPAytRUZ336vfbZm41zh6Rz5TlBjAB31VLOyCaLU7Yj1X5cyJDrCqdWBUJmMpHil/W@T3eL8/XOHLPbwxJXP1xIspFlmTaooRbSvevYdzEAG9ho4BT67hq//PNnluuDC9/4CqZptzQN2JfsQ8H1JXbK9/mKYY5UqliWrxHKWSUW7N@g8)
  
  
# Using ScriptEngine, ~~92~~ 87 bytes
Eval train coming through. Technically this is passing the torch to JS, so it's not my main submission. 
```
n->new javax.script.ScriptEngineManager().getEngineByName("js").eval(n.replace("'",""))
```
[TIO](https://tio.run/##XY4xa8MwEEZ3/YpDSyRIRHfTDoV4azt4LBkuysmRap@NdHEcQn67a0qmTh98PHgv4YS7dPpZIgvlgJ6gvquvYyIvEEwjOXILxYKc83AtsJ89jRIHrlQRlOhhGuIJeoz8hL8PaP/DcFc1hNeFd29MV0irdHbF5ziKa/5mz21k@kDGlrKxrqXn9X77xJ6MTkVbRxN2hl2msVtLjd7ordbWLpVqbkWod8NF3LhWSMcmuGD0y1yHlajU47H8Ag)
]